How to SSH to remote server without entering password each time.

ssh-copy-id  example_user@www.example.com

and give password once. Then you will be able to ssh without password next time onwards.

Make sure you have a ssh key generated in your local machine. This works for Linux only (not Mac, Windows etc.)

For Mac you need to first setup ssh-copy-id command & then copy the ssh key

sudo curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id

sudo chmod +x /usr/local/bin/ssh-copy-id

ssh-copy-id -i /path/id_rsa.pub example_user@www.example.com  

Now you have your ssh-key copied to your server. You can now try your normal ssh login command without entering password

Comments

Post a Comment

Popular posts from this blog

How to redirect a URL in NGINX

Ruby on Rails Installation on Windows 7