How to Generate SSH Keys on Windows, Mac and Linux

Create secure remote connections w/o passwords

If you’re looking to connect remotely to a computer, one of the best and most secure methods is to use a Secure Shell (SSH) connection. This creates an encrypted connection between you and the remote host, ensuring that the data being sent can’t be intercepted or monitored in any way.

You can use SSH as a tunnel for other traffic, too, such as asecure 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 thepublickey to the remote device.

Theprivatekey 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.

The well-known PuTTY SSH client is the default client for most Windows users. It includes several other tools for establishing SSH connections, includingPuTTYgen, 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, thessh-keygentool 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 almostall 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 youget around a school or workplace firewallusing an SSH tunnel. You can also use SSH toconnect to (and update) a Raspberry Pior 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.

Ben Stockton is a freelance technology writer based in the United Kingdom. In a past life, Ben was a college lecturer in the UK, training teens and adults. Since leaving the classroom, Ben has taken his teaching experience and applied it to writing tech how-to guides and tutorials, specialising in Linux, Windows, and Android. He has a degree in History and a postgraduate qualification in Computing.Read Ben’s Full Bio

Leave a Reply

Your email address will not be published.Required fields are marked*

Comment*

Name*

Email*

Website

Welcome to Help Desk Geek- a blog full of tech tips from trusted tech experts. We have thousands of articles and guides to help you troubleshoot any issue. Our articles have been read over 150 million times since we launched in 2008.

HomeAbout UsEditorial StandardsContact UsTerms of Use

Copyright © 2008-2024 Help Desk Geek.com, LLC All Rights Reserved