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
Written by Jasdeep Singh
Related protips
3 Responses
This method does use the Public-Key encryption mechanism. The little tool copies over your public key to your servers authorized_keys.
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
If manually adding the file, be sure to set it's permissions to 600
chmod 600 ~/.ssh/authorized_keys