LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-20-2006, 12:02 AM   #1
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
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.
 
Old 11-20-2006, 03:04 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Micro420
I have to use 'sudo' for root privileges.
I would think that putting sudo in front of your rsync command would work. If this needs to run as batch, you could create a special account that could run this w/o sudo requiring the password. If you don't know how to do this, consult the man pages for the sudoers file and the visudo command.

Quote:
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'.
If you are talking about trying to crack into your server using ssh, you can configure sshd not to accept root logins. For other accounts, requiring keys is good additional protection, where feasible. You can also use your firewall and/or tcp_wrappers to limit which IP addresses have access. If you're worried about vulnerabilities in the services you offer, those services should not be running as root.

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.

Last edited by blackhole54; 11-20-2006 at 04:08 AM.
 
Old 11-23-2006, 01:13 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,656

Rep: Reputation: Disabled
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/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RAID 1 or RSYNC BACKUP otagojo Linux - General 7 08-01-2005 12:34 AM
rsync as backup? ziggie216 Linux - Software 3 03-13-2005 02:22 PM
Problem with data backup using rsync and samba coolamit78 Linux - Networking 0 10-31-2004 09:01 AM
Rsync to mirror data for backup - having difficulties tapanga Linux - Newbie 1 05-17-2004 05:45 PM
rsync backup... tarballed Linux - Networking 10 06-27-2003 10:43 AM


All times are GMT -5. The time now is 11:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration