Table of Contents

How To Set Up SSH Keys on Linux

SSH keys are a very useful tool, as they both make it much easier to login AND make your SSH access much more secure. Plus, they're not that hard to set up!

Generate an SSH Key

If you haven't already, you'll need to create an SSH key. To do so, you can use the ssh-keygen tool like so:

ssh-keygen -t rsa -b 4096 -C "myuser@myhost"

Copy the Key

Copying the key also extremely easy, and again it's thanks to another tool in the SSH toolchain. ssh-copy-id does exactly what you think it would: copy a key! It's used much like the ssh command:

ssh-copy-id user@host

Test It!

That's all that you need to do! Now you just need to test the setup. Simply SSH in as the user and host that you copied the key to, and see if you get prompted for a password or not.