cmd for booting PuTTY – SSH client for Windows – on a specific server

23 Apr

Most of my day-to-day work is done on Windows, however for more computationally complex things (bioinformatics) I have access to my current university’s computing cluster (running Linux). On my home PC, I’ve mapped my cluster home directory for convenience, but I still need to connect via SSH to the server to make use of the cluster.

Running PuTTY to connect is easy, but still takes a couple of keypresses more than I would like to do. Thankfully, it can be booted to a specific server from the command prompt with the following code:

> putty.exe -ssh user@server_alias port

There is, of course, an option to pass the password via the command line as well, however, if you’re using this as a batch script as I have done, saving unencrypted passwords in text files isn’t secure at all. So, best practice is to still have you type it into the prompt once PuTTY loads the server.