Using rsync to backup data. Best way to backup folders?
I want to use rsync to backup an entire partition from Computer A to Computer B. This partition has files and directories with various permissions on it, some that I have access to and some that I don't (I am, however, the system administrator). How do I create a "universal" backup account that will let me read all the data on the partition so that I can rsync it? I am using Ubuntu so I don't have a 'root' account, and I don't want to make one since script kiddies keep trying to hack into my server with username 'root'. I have to use 'sudo' for root privileges.
|
Quote:
Quote:
EDIT: I'm sorry. I was thinking your problem was with access at the machine you were rsyncing from. For the machine you are rsyncing to, I can think of a couple of things. First of all, if this is going over the Internet, or an untrusted local network, I hope you are doing this over ssh rather than rsh (using the -e option). And I certainly hope you don't allow rsh access to this machine from the Internet! The way I can think of avoiding root that might work is to use the --rsync-path option to point to a script on the remote machine that that contains the command sudo /usr/bin/rsync $*. This would have to be run as a user that can sudo w/o entering a password as explained above. There might yet be a few kinks to work out in this proposal. :) The other way would involve creating a root account, but only allowing access to it via sshd without a password (i.e. only with a DSA or RSA key). You can do this either by disabling the password for the root account or by specifying without-passwd for PermitRootLogin in sshd_config. If you disable the password, you need to take care to do it in such a way that sshd doesn't refuse all access to that account. IIRC you can do that by placing one but not two exclamation points in front of root's password in /etc/shadow. |
I seem to remember that you don't have to be root for rsync -- since it creates just the same pattern of groups and permissions on the new site, but I'm not sure and can't look it up right now. Have you ever thought about rsnapshot?
http://www.rsnapshot.org/ |
All times are GMT -5. The time now is 04:11 PM. |