How to Create and Copy SSH Keys with 2 Simple Commands (+Video Tutorial)
SSH keys provide a secure and convenient way to authenticate remote servers. In this step-by-step tutorial, Jack Wallen explains how to easily create and copy SSH keys.
If you frequently access remote servers with the help of Secure Shell, I highly recommend you use SSH key authentication for heightened security. For those who’ve never used SSH keys before, I’m here to show you just how easy it is.
And if your admins have set up the servers you need to access for SSH key authentication, you’ll want to take care of this right away. After all, they could configure those servers to no longer accept password authentication, which means you could find yourself without access. So, how do you create the required SSH keys and copy them to the server? It’s actually very simple. Here’s how.
- Open a terminal window on the machine you’ll use to access the servers.
- Create your SSH keys with the command
- You will be required to select a directory to house the keys; I suggest accepting the default.
- Type and verify a password for the key pair. Now you’re ready to copy your new key to the server.
- Let’s say that the server is at IP address 192.168.1.62. To copy the key, issue the command
- If you’ve never used SSH to access that server, you’ll first be prompted to type yes to continue.
- You will be prompted to type the remote user’s password.
- With the key copied, you can test the connection by using SSH to connect, where you’ll be prompted to type your SSH key password and not your user password.
ssh-keygen
ssh-copy-id 192.168.1.62
Congratulations! You just set up SSH key authentication so you can more securely connect to your remote servers.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.