Hi:
I've set-up password-less SSH login for some remote servers. Everything is now working correctly, except when I try to transfer root-owned files using SCP, because now the command becomes "sudo scp ...". Now I have to enter the password for my remote account (obviously I have to enter my own local password due to the use of "sudo", which is not a problem) before beginning the transfer.
I remembered that in order to set-up password-less SSH login, I had to add public/private key files to ~/.ssh/, I copied those files to /root/.ssh/. Afterwards, it wouldn't ask me for the remote account password, but it would ask me for the passphrase for the private key file. So I started a root shell using "sudo su", ran "exec ssh-agent bash", and then ran "ssh-add /root/.ssh/id_rsa". However, when I exit out of the root shell, all my identities have been removed (i.e., "ssh-add -l" shows no identities). Now, if I start a root shell again, and run "ssh-add -l", it also shows no identities.
Can someone tell me the correct way to enable password-less ssh login when transferring root-owned files?
Cheers,
LK
Bookmarks