Table of Contents

public key authentication

:!: UPDATE - using ssh-copy-id is easier. See this page: http://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password

You know you can connect to a host with ssh by typing a password when requested. However it is usually easier, especially for a scripted environment, to run ssh without having to type the password. This also keeps the user password safe.

  1. on the connecting client, NOT the ssh server host, generate a public/private key pair (don't type a password when asked)
    ssh-keygen
  2. this creates a private key ~/.ssh/id_rsa, and a public key ~/.ssh/id_rsa.pub
  3. the single line inside the public key file needs copied to a file on the ssh server host at ~/.ssh/authorized_keys

Troubleshooting

If you still get a password prompt, try to correct these items:

Notes