rsync over ssh: authentication by cryptographic key
I have 2 boxes, both using Slackware64 ver. 13.
Box1 - ssh server and rsync server daemon are functional. Box2 - client box that connects to Box1 by ssh as well as rsync by way of ssh. I followed the instructions in Chapter 2 of the O'Reilly book "The Secure Shell, The Definitive Guide" to setup ssh authentication by pub/private keys. The configuration works, but only once, and upon re-logging into Box2, I find I have to go through the following setup to make it work again - $ssh-agent $SHELL $ssh-add /home/mike/.ssh/id_rsa then prompted to provide passphrase. Then rsync over ssh will work - example: rsync -e "ssh -p 45000" -avzi mike@10.10.10.100:/zzz /mnt/current I want to get it configured so that it works every time with no user input, in order to configure automatic cronjobs using rsync commands like the one above. Thanks for your help. |
This should do it: http://www.csua.berkeley.edu/~ranga/...sh_nopass.html
|
Thanks Mpapet, I'll give it a try over lunch. :-)
|
I completed the instructions according to the linked web-page and it works perfectly when I am logged in as the user; however, it does not work when logged in as root. When I execute the rsync-via-ssh bash script, I get prompted for a password.
I think I've found a new issue that requires a new question -- Is it possible to run a particular cronjob as a user? I believe when I put the rsync bash script in as a cronjob, it is executed by the root account, and will fail to complete just like it did when I try manually while logged in as root. Is this the correct way to state a user-specified cronjob? - 15 * * * * mike /home/mike/my_rsync_bash_script >> /dev/null 2>&1 Thanks for your time and help. Very much appreciated. |
Quote:
Just run through the same key generation steps (and the steps that follow) for root, and you should be in business. |
Quote:
Thanks to you too, Anomie. |
All times are GMT -5. The time now is 02:25 AM. |