I use rsync
to mirror a number of folders on our failover server. However, some of our files, such as thumbnails or full-text indexes, are generated by our applications under the web user (named 'nobody'), and default to restrictive permissions.
Also, I'm doing this over ssh, where root access is disabled, and I'd like to keep it that way, if possible.
Is there any reasonable way I can tell rsync to run as sudo? Or should I look into changing the file permissions?
Best Answer
you could:
With #2 you could use rsync over ssh to the root user and still be secure (see PermitRootLogin no-password in sshd_config(5)), or even better you could combine the two to create a non-privileged user which can only be used with that specific rsync command line.
EDIT: sending auth data over ssh to get root (eg. ssh as user, sudo with user password) is not better than doing ssh directly to the root user (via public key or via a good password), IMHO.