Link to home
Start Free TrialLog in
Avatar of Jason Yu
Jason YuFlag for United States of America

asked on

how to set up rsync user to run a rsync script

I have two application servers clustered behind a load balancer on aws. Both of them connect to a ldap server for authentication.

I have a rsync script to run on the second application server to sync the cache folder from the first server. I can run the rysnc script under root user without problem. But how can I add it to cron job to run it automatically. Do I need a special user to run it or I can run it under "root" user?

Also, I think I need implement keyless ssh authentication. How could I do it?

thanks.
ASKER CERTIFIED SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jason Yu

ASKER

I got the following error after I copied the id_rsa.pub key to the authorized_keys file on the remote host.


[root@magentoprod-apache1 .ssh]# rsync -a /var/www/html/var/cache/ root@10.104.1.24:/var/www/html/var/cache
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
[root@magentoprod-apache1 .ssh]# ls -alth
total 20K
drwx------. 2 root root   76 Jul 14 15:11 .
-rw-------  1 root root  953 Jul 14 15:11 authorized_keys
-rw-------  1 root root 1.7K Jul 14 15:06 id_rsa
-rw-r--r--  1 root root  406 Jul 14 15:06 id_rsa.pub
-rw-r--r--  1 root root  173 Jul 12 14:51 known_hosts
dr-xr-x---. 4 root root 4.0K Jun 23 10:03 ..
[root@magentoprod-apache1 .ssh]#