You can use SSH as a tunnel for other traffic, too, such as a secure VNC connection over SSH. One way you can make your SSH connections even safer is to use SSH keys, which replaces potentially easy-to-crack passwords with a 617-digit encryption key. Here’s how to generate new SSH keys on Windows, Mac, and Linux computers.
What Are SSH Keys?
SSH keys allow you to create secure connections to remote servers or PCs without using a password using the Secure Shell protocol. SSH keys are created in pairs, with a private key and a public key that remain connected—one can’t be used without the other. In most cases, the public key remains on the remote PC or server to encrypt the connection. The private key is then used to authenticate with that remote device, allowing you to connect and use it without supplying a password. Public and private SSH keys are two parts of the same whole—without the private key, you can’t authenticate with the public key and establish a connection, and without the public key, the private key is useless. You can generate new SSH keys on Windows, Mac, and Linux, then transfer the public key to the remote device. The private key is then stored safely on your PC or Mac. It’s important to save a copy of this key securely (for instance, using a password manager). If you lose it, you may not be able to re-establish your remote connections. It’s also important not to share either your public or private key with others, but especially your private key (or the passphrase that may decrypt it). With the private key at their disposal, a rogue user will be able to establish a connection to your remote device without requiring any additional authentication.
How to Use Windows to Generate SSH Keys
You can use Windows to generate SSH keys using the built-in OpenSSH client or the popular, third-party PuTTY client. If you’d prefer to use a graphical user interface (GUI) to create new SSH keys, PuTTY is the best option. If you’d rather use built-in software, then use OpenSSH (via the Windows PowerShell) instead.
Using OpenSSH via Windows PowerShell
Using PuTTY
The well-known PuTTY SSH client is the default client for most Windows users. It includes several other tools for establishing SSH connections, including PuTTYgen, a tool for generating new SSH keys.
How to Generate SSH Keys on Linux or Mac
OpenSSH is the gold standard set of tools for SSH management and, just like the Windows version, the ssh-keygen tool remains the best way to generate new SSH keys on Mac or Linux computers. As a consequence, GUI tools for generating SSH keys are rare and not typically recommended. As the OpenSSH tools are included with all Mac computers and with almost all Linux distributions, the steps below should work for both platforms.
Making Secure Connections Using SSH
Once you’ve generated your SSH keys, you’ll need to make sure to copy the public key to your remote PC, Mac, or server. This links with your private key, which allows your preferred SSH client to establish secure SSH connections without a typical password. For instance, you could use SSH to connect to another Mac remotely. Secure SSH connections can also help you get around a school or workplace firewall using an SSH tunnel. You can also use SSH to connect to (and update) a Raspberry Pi or other Linux-based PCs and servers. You’ll need to make sure you enable the OpenSSH server if you want to do this on Windows 10, however.