SSH without a Password

Entering passwords is really annoying if you SSH into servers on a regular basis. Here’s how to add your SSH key to the remote host so you no longer have to do so!

  1. Start on your local machine (the machine you use to tap into the remote host)
  2. Copy to home directory of remote host

    $ scp ~/.ssh/ [user]@[remote hostname]:~
  3. SSH into server and enter password. Celebrate that this will be the last time you will need to do this.

    $ ssh [user]@[remote hostname]
  4. Add to authorized_keys

    $ cat ~/ >> ~/.ssh/authorized_keys
  5. Remove and exit remote server

    ~ $ rm ~/
    ~ $ exit
  6. Test it! You should no longer be prompted to enter a password!

    $ ssh [user]@[remote hostname]

There are alot of assumptions made in this guide, so if you run into problems, the Ubuntu Community Wiki is very helpful for troubleshooting!

comments powered by Disqus