MacOS – How to manage multiple ssh sessions with ease on Mac OS X

macosssh

At my upcoming job i will handle many servers with SSH access. It will be like ~100-120 hosts, with different username on most of the hosts, and i'm pretty sure i will not remember each host domain name, not to mention which username is on each host.

Is there a tool for Mac OS X (Lion preferably) which would allow me to define a session for each host (in a session i mean username and some ssh options), show list of such sessions and connect on click/select automatically?

Best Answer

There are two ways I manage, or have seen people manage, SSH data:

Good 'ole, command line, plain text, ssh_config file.

Create a file called config inside ~/.ssh. You can specify global parameters by putting them above any host declarations. When I started using MacPorts, I had to explicitly define a default SSH Private Key to use automatically when connecting, so as the very first line of the file I put;

IdentityFile ~/.ssh/id_rsa

When you define custom rules for hosts (and you can even use * as a wildcard), it looks something like this:

Host prod-*
  User jason
  Port 2222
  LocalForward 5901 localhost:5901
  IdentityFile ~/.ssh/work-id_rsa

Then when I run ssh prod-script for example, all the rest of the rules get applied automatically.


A lot of people who don't want to manually manage all their stuff in such a cumbersome manner quickly find JellyfiSSH. (Mac App Store Link. The same people also became very annoyed when it stopped being downloadable for free.)

JellyfiSSH gives you GUI access to almost everything that can be specified in the command line or ssh_config file. JellyfiSSH is just a configuration storage app for organization purposes, because it generates the commands based off the options you set and upon clicking connect, opens a new terminal window with all of your options defined on the command line. JellyfiSSH is not a terminal app on it's own.