
If you frequently SSH into remote servers, managing connections can be tedious. iTerm2, a powerful terminal for macOS, makes this easier with custom profiles that let you connect to servers instantly. In this post, I’ll show you how to set up profiles for both single and multiple server connections. With one-click access, you can streamline your workflow and eliminate repetitive logins.
Setting Up Single Server 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 Profile 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
- 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, you should profile in the Toolbelt
- Simply click on a profile to launch it or Use shortkut Keys
The Toolbelt provides a persistent sidebar with all your profiles, making it incredibly convenient to launch SSH connections with a single click. But that’s not all—the Toolbelt also offers several other useful options, such as quick access to your command history, Codecierge, and more. This setup works great for anyone who regularly needs to access multiple servers simultaneously. Plus, the profiles persist across iTerm2 sessions, ensuring a seamless experience every time you use it. With the Toolbelt, you can enhance your workflow in many ways, making it a versatile solution for your daily SSH needs.
If you are interested in learning about iTerm2 AI features then check my article here
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