Many folks coming from the Windows world often ask where they can find the PuTTY client for OS X. While I do not wish to undermine the quality of the client (as it is, quite likely, the best for Windows), there is no such need for it on OS X. Why? This is simple – because all of the functionality that PuTTY offers, such as SSH, Telnet and Serial abilities come bundled with your OS X install. Since OS X is based on UNIX, it comes with a massive array of utilities that can be found across most different UNIX based OS’s and SSH and Telnet is no exception. (If you must install PuTTY on your computer, just read our other article How To Install PuTTY On OS X.)
Although you won’t find a pretty interface for performing your SSH/Telnet needs, it is nevertheless very simple to do (and without having to be a UNIX enthusiast). So how do you do it? Via the ‘Terminal‘ App, of course!
So let us begin.
In most cases, there are only 3 options that most people require from SSH and they are:
- Be able to specify an IP/Hostname
- Be able to specify an SSH/Telnet port
- Be able to specify a private SSH key
All of the above can be achieved very easily and quickly. First, open the ‘Applications‘ folder (cmd-shift-a from Finder or go to your Disk->Applications). Locate the ‘Terminal’ application and drag it over to your Dock. Once there, click the ‘Terminal’ icon and a prompt will pop up. From here, you are just a few keyboard strikes away from SSH’ing and telnet’ing your way around the internets.
To ‘ssh’ to a host, type ‘ssh [email protected]‘. This is rather self-explanatory – ‘ssh‘ is the command which invokes the ‘ssh’ program, ‘username‘ is the user you wish to connect as, and ‘hostname.com‘ is the host you wish to connect to. While there are multiple different syntaxes for ‘ssh’, this is likely the simplest one to remember.
Now that we’ve covered how to ‘ssh‘ to a host, lets specify a port. With no more than a couple of more keystrokes we can achieve just that. Same way as we specified the command before, this time around we just tack on a ‘-p 2222‘ to the end of the command. The ‘-p‘ is a command line option that takes an argument. So, the end result:
And finally, lets discuss how to use a private SSH key when connecting to a server via SSH. As you can probably already tell, this is achieved via a command line option as well. The option in question is ‘-i‘ and the argument that this option takes is the location of the private key. If you are unfamiliar with UNIX then locating the private key via the Terminal might be a bit confusing, but thankfully, the OS X terminal has a nice and simple solution to this.
Assuming your private key file is located on the Desktop, you can simply drag it over ‘on top’ of the Terminal window and the path to the key will be automatically added, saving you a whole lot of typing.
As you can see, you can specify multiple options in the same command!
There are many, many more other things you can accomplish with the ‘ssh’ client, however these subjects are beyond the scope of this quick intro.
And as a final note – the default color scheme for Terminal is rather ugly and many do not know that the Terminal can, in fact, be just as pretty as any other OS X app. To do so – go to Terminal->Preferences->Settings, select the ‘Pro‘ color scheme/theme and press the ‘Default‘ button. Quit the Terminal application and relaunch. You should now see a Terminal just like in the screenshots above 🙂