Nav links

Monday, 5 November 2018

SSH clients in Windows

Windows 10 has many SSH client options. For ten or fifteen years I have used PuTTY and its related tools for my telnet and SSH needs. For sound security reasons it doesn't offer the ability to script logins and save passwords, though you can achieve this by starting PuTTY from WinSCP. A better solution is to avoid passwords altogether, and use a public key. My motivation for doing this was for more convenient access to my Raspberry Pi, for which I had recently added a complicated and forgettable password . Using a public key I no longer need to remember or look up a password, and it wasn't too hard to set up. I now use keys rather than passwords everywhere.

While doing the switch from passwords to public keys I also found many newer SSH clients options  now exist in Windows. Here are the main ones:

Git for Windows, which you may already have installed, has ssh and its related features available within the Git Bash tool. If you're using a passphrase for your key then you'll also find it useful to set up the ssh-agent to auto-launch.

If you install the Windows Subsystem for Linux then from a command prompt you can run:

wsl ssh myserver

Note that I use an SSH config file to simplify the connection command, so I don't need to enter the full hostname or username.

However, you probably wouldn't want to install the whole of WSL just for a little SSH client, especially as Windows 10 now has an SSH client built in. See their OpenSSH blog article for details.

After setting that up, if necessary (it's installed by default in recent releases of Windows 10), you can run the following from a command prompt:

ssh myserver


This last option has, at present, some minor bugs, such as the inability to resize the window after an SSH session has commenced. This bug is described in TTY PTY support in Windows OpenSSH.