Thanks both for the tip about rsync over ssh.  I've managed to set it up
using a public key, so that it doesn't ask me for a password.  When I
run my rsync command as user 'tc' it runs fine.

But now I want to set it up so that it also runs as 'root', which I
believe is the user that runs cron jobs.  So I did a 'sudo su' on both
machines, and repeated the process:
1) I used ssh-keygen to create id_rsa.pub and id_rsa in /root/.ssh on
the host machine
2) I copied /root/.ssh/id_rsa.pub on the host to
/root/.ssh/authorized_keys on the remote machine, and checked that the
permissions and ownership were correct for the root user.

I then tried to ssh from host to remote (ssh [email protected] - still as
sudo su), but it asks me for a password, so something about permissions
isn't correct I expect.  While still su, I also tried ssh
[email protected], and ssh -i /home/tc/.ssh/id_rsa.pub [email protected], and
they both failed (probably because the permissions for /home/tc/.ssh are
restricted to the owner 'tc', which I think is needed to make it work
for user 'tc').  

My script will have several rsync calls, and since they will specify
[email protected], I figure I could either spend the rest of my life
wrestling with permissions, or just get everything working for user 'tc'
and then have my script run as user 'tc', even when triggered by cron.

Is there a way to get the cron job to run my script as 'tc'?

If not, is there an approved way to give 'root' user enough access to
/home/tc/.ssh without breaking it for user 'tc'?


------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=113676

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to