Setting up passwordless SSH in 2 easy steps

in Linux, SSH, key, password, command line

There are times when you really want to get rid of SSH password authentication, however SSH is VERY picky about permissions etc. I just found out that there's a tool for that in all Linux boxes!

As promised, the two simple steps:

  1. Create your keypair (assuming you don't already have it ready)
    $ ssh-keygen -t rsa
    Make sure NOT to enter a passphrase, or you'll have to enter that every time you use the keypair!
  2. Copy it over to the server and make all necessary adjustments (create directory, fix permissions, etc)
    $ ssh-copy-id -i id_rsa.pub user@example.com
    You'll be prompted for your password, and then notified that you can now try logging into the server.
  3. Enjoy!