====== 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" * ''%%ssh-keygen%%'' - the command/binary we want to run. * ''%%-t rsa%%'' - the encryption algorithm type to use. * ''%%-b 4096%%'' - the number of bits to use for key generation (higher = more secure, but slower). * ''%%-C "myuser@myhost"%%'' - comment for the SSH key. This can be whatever you want, though typically I use something like "user@host" to denote for who and where the key is for. ===== 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 * ''%%ssh-copy-id%%'' - the command/binary we want to run. * ''%%user@host%%'' - the username and hostname of the system we want to copy the SSH key to. ===== 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. * If there's NO password prompt and you're logged in - great! You did it correctly! * If there IS a password prompt, you may have mistyped something somewhere. Double-check your steps and make sure you typed everything in correctly.