3.3 Set up SSH

Log in as crichtonj, or use su crichtonj to act as that user temporarily. First, set up the SSH keys for this user:

ssh-keygen  
    

You can accept all the defaults, and do not specify a passphrase. Just press ENTER when asked to enter a passphrase. Otherwise, you cannot automate the back up process.

Next, you need to send the public key to the server to be backed up, and append it to the end of a file called authorized_keys.

cat ~/.ssh/id_rsa.pub | ssh oneilj@someserver "cat >> ~/.ssh/authorized_keys"  
    

You can now test to see if you can log in as oneilj on the server to be backed up without being asked a password:

ssh oneilj@someserver "ls -lR"  
    

If this does not ask you for a password, and lists the content of the home folder of oneilj, then the configuration is successful.