Make SSH stop asking for a login password

Posted by jason on June 13, 2011, 10:15 p.m.
Tags: linux sysadmin

Here's how to set things up so that typing "ssh user@host" will just log you in and not ask for a password. You should probably only do this with trusted machines.

  1. Open a terminal
  2. Go to your .ssh folder
  3. cd ~/.ssh
    
  4. Check if you have a 'id_rsa.pub' (or 'id_dsa.pub') file there. If not, do this:
  5. ssh-keygen -t rsa
    

    Press enter a bunch of times, even when it asks for a password.

  6. Run ssh-copy-id
  7. ssh-copy-id -i id_rsa.pub user@host
    
  8. Test
  9. ssh user@host
    

    You should have been logged in without being prompted for a password. If not, go to step 1 or google the error message you got.


0 comments