password less authentication with ssh

From WebHostingNeeds.com
Jump to: navigation, search

When doing things like secure automated backups via ssh and/or rsync over ssh, you will need to setup password less authentication so that you are not prompted to enter the password for the ssh connection. This is very easy to do on your Dedicated Server and is broken into two parts.

Client Side

see if key already exists

cat ~/.ssh/id_rsa.pub

if not create it

ssh-keygen -t rsa -b 2048 -C "[email protected]"
cat ~/.ssh/id_rsa.pub

For windows instruction, see generate ssh key in windows

Server Side

mkdir /root/.ssh
chmod 700 /root/.ssh
chmod 644 /root/.ssh/authorized_keys
vi /root/.ssh/authorized_keys

In the file, put content of ~/.ssh/id_rsa.pub you created in client side.


Now you should be able to ssh/scp/rsync to the remote host securely and without having to authenticate.



ssh-keygen

server refused our key

ssh

linux commands