Last Updated: February 25, 2016
·
1.292K
· jasdeepsingh

Easily Enable Password-less SSH Logins

I absolutely hate entering in my passwords to different servers I SSH into. And with so many servers at our disposal. I cannot remember the passwords to them all.

Here's a handy trick to quickly and painlessly add your public SSH keys to your servers ~/.ssh/authorized_keys

$ ssh root@server-name.com
root@server-name.com password: 

Use this two liner to quickly copy over your public SSH keys to enable password-less logins:

$ brew install ssh-copy-id
$ ssh-copy-id root@server-name.com

Now, you can do just -

$ ssh root@server-name.com

Enjoy, I hope you find it handy!

PS: Offcourse, change root to your own username

3 Responses
Add your response

This method does use the Public-Key encryption mechanism. The little tool copies over your public key to your servers authorized_keys.

over 1 year ago ·

If you're using Windows or don't have access to ssh-copy-id, you can just copy and paste your id_rsa.pub key in to ~/.ssh/authorized_keys

over 1 year ago ·

If manually adding the file, be sure to set it's permissions to 600

chmod 600 ~/.ssh/authorized_keys

See http://stackoverflow.com/questions/6377009/adding-public-key-to-ssh-authorized-keys-does-not-log-me-in-automatically

over 1 year ago ·