[user@localhost ~]$ cat ~/.ssh/id_rsa.pub ~/.ssh/id_dsa.pub | ssh user@remotehost ’sh -c “cat - >> ~/.ssh/authorized_keys”‘
You’ll be prompted for the password just this one last time. This is perfect for running a script that runs several remote commands through ssh. Here’s a script that checks for your keys and adds them if …