
If you frequently SSH into remote servers, managing connections can be tedious. iTerm2 SSH profiles solve exactly this problem. iTerm2, a powerful terminal emulator for macOS, lets you save SSH commands as named profiles and connect to any server instantly with a single click or keyboard shortcut. In this guide I’ll show you how to set up iTerm2 SSH profiles for both single and multi-server connections — and how to access them in one click from the Toolbelt.
Table of Contents
- Prerequisites
- Setting Up a Single Server iTerm2 SSH Profile
- Setting Up Multi-Server Profiles with Split Panes
- Quick Access to Your iTerm2 SSH Profiles
Prerequisites
- iTerm2 installed on macOS — download from the official iTerm2 site
- SSH access credentials (hostname, username, key or password) for your target servers
Setting Up a Single Server iTerm2 SSH Profile
- Open iTerm2 → Preferences (⌘+,)
- Navigate to “Profiles” tab
- Click “+” to create a new profile
- Configure the profile:
- Name: Give it a descriptive name (e.g., “Production Server”)
- ShortCut Key: Select a key from drop-down
- Select “Command” under Command drop-down
- Enter your SSH command:
ssh username@server.example.com
Setting Up Multi-Server iTerm2 SSH Profiles with Split Panes
To connect to multiple servers simultaneously in split panes:
- Create a new profile as above
- Select “Login Shell” under Command drop-down
- ShortCut Key: Select a key from drop-down
- In “Send text at start:”, use an AppleScript command:
- Example AppleScript commands are given below:
# For 2 servers (horizontal split)
/usr/bin/osascript -e 'tell application "iTerm" to tell current window to set newTab to (create tab with default profile)' && /usr/bin/osascript -e 'tell application "iTerm" to tell current session of current window to split horizontally with default profile' && /usr/bin/osascript -e 'tell application "iTerm" to tell first session of current tab of current window to write text "ssh user@server1.example.com"' && /usr/bin/osascript -e 'tell application "iTerm" to tell second session of current tab of current window to write text "ssh user@server2.example.com"'
# For 3 servers (horizontal splits)
/usr/bin/osascript -e 'tell application "iTerm" to tell current window to set newTab to (create tab with default profile)' && /usr/bin/osascript -e 'tell application "iTerm" to tell current session of current window to split horizontally with default profile' && /usr/bin/osascript -e 'tell application "iTerm" to tell current session of current window to split horizontally with default profile' && /usr/bin/osascript -e 'tell application "iTerm" to tell first session of current tab of current window to write text "ssh user@server1.example.com"' && /usr/bin/osascript -e 'tell application "iTerm" to tell second session of current tab of current window to write text "ssh user@server2.example.com"' && /usr/bin/osascript -e 'tell application "iTerm" to tell third session of current tab of current window to write text "ssh user@server3.example.com"'
Quick Access to Your iTerm2 SSH Profiles
- Use ⌘O to open the profiles window
- Access profiles from the iTerm2 menu bar → Profiles
- Enable Toolbelt for easy profile access:
- View → Toggle Toolbelt (⌘+ shift+B)
- Click “Profiles” in the Toolbelt to see all your profiles listed
- Simply click on a profile to launch it or use shortcut keys
The Toolbelt provides a persistent sidebar with all your iTerm2 SSH profiles, making it incredibly convenient to launch connections with a single click. The Toolbelt also offers quick access to your command history, Codecierge, and more. Once set up, your profiles persist across iTerm2 sessions — no need to remember hostnames, usernames, or key paths ever again.
For a full reference on profile options, see the iTerm2 Profiles documentation. If you want to push your terminal workflow further, check my guides on iTerm2 AI features with Ollama and Aider for AI pair programming directly from the terminal.
Akash Gupta
Senior VoIP Engineer and AI Enthusiast

AI and VoIP Blog
Thank you for visiting the Blog. Hit the subscribe button to receive the next post right in your inbox. If you find this article helpful don't forget to share your feedback in the comments and hit the like/clap button. This will helps in knowing what topics resonate with you, allowing me to create more that keeps you informed.
Thank you for reading, and stay tuned for more insights and guides!
Leave a Reply