05 August 2015

Source: http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/

  1. Create public and private keys using ssh-key-gen on local-host
  2. Add public identity to ssh agent
  3. Copy the public key to remote-host using ssh-copy-id
  4. Check authorized_keys to check duplicated keys

Create public and private keys using ssh-key-gen on local-host

ssh-key-gen

Add public identity to ssh agent

ssh-add
=> enter passphrase

Copy the public key to remote-host using ssh-copy-id

ssh-copy-id appends public key to authorized key on remote host

ssh-copy-id -i ~/ssh/id_rsa.pub remote-host

Check authorized_keys file for duplicated entries

cat ~/.ssh/authorized_keys

login

ssh remote-host