Setting up password-less ssh access

To allow password-less ssh access from host C (client) to host S (server), you need to copy C’s public authentication key, typically ~/.ssh/id_rsa.pub to S and append it to S’s ~/.ssh/authorized_keys file.

You can copy this in two ways:

From client C:

cat ~/.ssh/id_rsa.pub | ssh <user>@<server> "cat >> ~/.ssh/authorized_keys”

Or more simply, if the ssh-copy-id command is available:

ssh-copy-id <user>@<server>

If C is a new computer without ssh set up on it yet, you need to first create the ~/.ssh folder

mkdir -p ~/.ssh

chmod 700 ~/.ssh

and then create the authentication key with a blank password (press Return at the prompt):

ssh-keygen -t rsa -b 4096