SSH without a password
Instructions on setting up ssh without a password and debuging possible errors.
Connecting from Client to Server as User on port Port.
Prepare server:
#First login to server ssh -p Port User@Server # Correct file permissions chmod 700 ~ chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys # Get back to Client exit
Create a key:
ssh-keygen -t rsa #Leave the password empty
Copy the public key to the Server
ssh-copy-id -i ~/.ssh/id_rsa -p Port User@Server
Verify its working:
ssh -p Port User@Server
Troubleshooting ssh without a password
Try connecting in verbose mode and watch for errors
ssh -vvv -p Port User@Server
SSH error : Permissions 0777 for “file” are too open.
chmod 644 ~/.ssh/*.pub # permissions for public keys chmod 600 ~/.ssh/private_key ~/.ssh/{config,known_hosts,authorized_keys} # permissions for private key & configs
SSH error : Bad owner or permissions on FILE
chown -R $USER ~/.ssh/
More instructions & information: http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/