AI and VoIP Blog

VOIP | AI | Cloud | Kamailio | Open Source


Easily Manage SSH Access with One-Click iTerm2 Profiles

iTerm2 SSH profiles settings in macOS Preferences

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

  1. Prerequisites
  2. Setting Up a Single Server iTerm2 SSH Profile
  3. Setting Up Multi-Server Profiles with Split Panes
  4. 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

  1. Open iTerm2 → Preferences (⌘+,)
  2. Navigate to “Profiles” tab
  3. Click “+” to create a new profile
  4. 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:

  1. Create a new profile as above
  2. Select “Login Shell” under Command drop-down
  3. ShortCut Key: Select a key from drop-down
  4. In “Send text at start:”, use an AppleScript command:
  5. 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.

Leave a Reply

Join 925 other subscribers

Akash Gupta
Senior VoIP Engineer and AI Enthusiast



Discover more from AI and VoIP Blog

Subscribe to get the latest posts sent to your email.



Leave a Reply

Discover more from AI and VoIP Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading