Quick and dirty no password ssh

Why login to a server with a password when you don’t have to?  When you are administering a lot of servers, it’s so much easier to let SSH keys handle logins and it’s easy to set up.  Here’s how to quickly set up your servers to log into SSH without a password.

  1. Create a public and private key pair
    1. Step 1 assumes you don’t already have a key pair that to use.  If you already have a key pair, you can skip to step 2 and use what you have.
    2. run `ssh-keygen` and follow wizard.
      1. You can press Enter twice to avoid a passphrase but I don’t recommend it.  Just use PuTTY’s pagent utility to manage your keys with passwords.  Really easy.
  2. Copy public key to the remote hosts using ssh-copy-id
    1. ssh-copy-id will append to the remote host’s .ssh/authorized_keys file so you don’t clobber any existing keys
    2. ssh-copy-id -i ~/.ssh/id_rsa.pub @
      1. Be sure to use the -i with ssh-copy-id to specify your public key path, otherwise you’ll get the error ‘No identities found’
  3. Test your passwordless login
    1. ssh

 



Leave a comment