How to get access to a server through SSH without password: Public Key Authentication
If you get access to your servers through SSH then getting to a server without entering password every time can be very convenient. This tutorial teaches how to connect to a server without entering password.
First log in to the server and check if /etc/ssh/sshd_config has
PubkeyAuthentication noentry. By default it shouldn't be there. But if it's there, change it to yes
Then go in home directory of the user on the client machine that will work with the server and check if permissions to .ssh catalog have value 700 or change it just in case:
chmod 700 /home/user/.ssh
Logged in with this user ( without sudo ) do the following:
ssh-keygen cat ~/.ssh/id_rsa.pub | ssh user@server "mkdir -p .ssh; chmod 700 .ssh; cat >> .ssh/authorized_keys"
Here we create a couple of keys to access the server through SSH and copy our public-key to the server. To check if it worked do:
If you did it all correct you should be able to get access the server without entering password.
This work is licensed under a Creative Commons Attribution-NoDerivs 3.0 United States License.
Got a comment?
All Rights Reserved.