bash$ ssh-keygen Generating public/private rsa1 key pair. Enter file in which to save the key (/home/bob/.ssh/identity): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/bob/.ssh/identity. Your public key has been saved in /home/bob/.ssh/identity.pub. The key fingerprint is: 9c:32:e7:09:68:eb:49:21:45:30:49:f9:05:08:6f:7c email@example.com
This will create the ssh1 key. Next type:
bash$ ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/bob/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/bob/.ssh/id_dsa. Your public key has been saved in /home/bob/.ssh/id_dsa.pub. The key fingerprint is: 55:cc:60:97:67:2f:52:0f:e7:da:76:fc:5f:b6:88:1c firstname.lastname@example.org
This will create the ssh2 key. Now take the files that end in .pub and copy them into files authorized_keys and authorized_keys2 like this:
bash$ cp identity.pub authorized_keys bash$ cp id_dsa.pub authorized_keys2
When you copy these files into the .ssh/ directory of the account you want to log into, they should enable you to authenticate using the keys instead of a password. All you still need to do is create a shell script to copy the files using scp.
Here is an example scp command:
bash$ scp backupdata.tar.gz email@example.com:backupdir/