From S2 I am invoking the rsync command as User2. There is an account on S1, User2, and it has been added to the sudo group. The rsync command ssh's to S1 using the account User1, the main root user login of that server.
Originally Posted by bab1
Here is a more complete and descriptive c/p of the command...
I was thinking that "--super" was forcing root user (via sudo), but perhaps I misunderstood how this is applied when reading the man page.
User2@S2:~$ rsync -az --super User1@<S1 IP>:/srv/samba/ /srv/samba/
I have tried...
...but this requires me to enter my sudo password for S2, which would kill any chance of automation, which is kind of moot anyway as it fails anyway with...
User2@S2:~$ sudo rsync -az --super User1@<S1 IP>:/srv/samba/ /srv/samba/
For this to work, to allow sudo over ssh, do I need to allow root logins? From all I have read this would seem inadvisable, but perhaps I am overlooking something. Is there a way to invoke sudo over ssh without the need for entering a password, and while maintaining reasonable security? Automation is a key component of what I am looking for.
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9]
Thanks for the help.