LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 07-06-2005, 12:55 PM   #1
nifflerX
Member
 
Registered: Dec 2003
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94

Rep: Reputation: 16
rsync with permissions, but not as root


Hi,

I'm running linux redhat Enterprise WS v.4 and I'm trying to use rsync to backup some data. In the past I've been able to run a rsync command and using the built-in ssh feature move the data to another machine. Since I ran the rsync as root I was able to keep all the permissions, time stamps and other information about the files being backed up. However, now I'm trying to setup a more permanent system and I'm a little wary about running a process like this as root each night. So, I guess my question is two-fold. The first part is, is there a way to run a rsync backup, not as root, but still keep all the permissions, ownership, and time stamp information? The second part is, if it's not possible, is is pretty safe to run this operation as root? Thanks very much.


-NifflerX
 
Old 07-07-2005, 10:13 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Short answers:
1) No, it's not possible. Only the superuser account can change file ownership and permissions for all files
2) You're worrying too much. Running rsync as root is perfectly fine. Consider this: your mail daemon is running as root all day, everyday.

Longer answer:
1) It could be possible to do the ownership and permissions business as a non-root user with the help of sudo, but it overly complicates matters (in my opinion). You create a special user to run the rsync process; the account is disabled from logging in at all (login shell of /bin/false for example). You run the rsync script as this user. Once the rsync completes, the rest of the script goes about changing file ownership and permissions using sudo. You configure sudo to allow the rsync user to run those commands as root and without a password since only root can change those attributes and no password because you don't want to enter that for every file you copied over. I don't know about anything to maintain timestamps...

There may be a much simpler way of accomplishing the above without running as root, but I think you're overly worried about it.
 
Old 07-08-2005, 04:04 AM   #3
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
Dark Helmet is right

it only becomes an issue if there is an exploitable bug in rsync (and there always is), so when a bug is discovered it might be an idea to update rsync. But in the meantime, you're secure.

Besides you still have a firewall between the servers and the rest of the world.
 
Old 07-08-2005, 10:11 AM   #4
nifflerX
Member
 
Registered: Dec 2003
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94

Original Poster
Rep: Reputation: 16
Thanks so much for putting my mind at ease. I'll just make sure to keep rsync up to date. Thanks again.


-NifflerX
 
Old 09-29-2011, 12:10 AM   #5
The Hound
LQ Newbie
 
Registered: Sep 2011
Location: Texas
Distribution: Debian, Ubuntu, Fedora
Posts: 3

Rep: Reputation: Disabled
rsync and no root

I see this is a very old thread, and I'm pretty much a noob, but there are legitimate reasons for wanting to do this. My VPS was hacked and I had to disable root login. (It is exponentially harder to guess both a user name and a password than just to guess root's password.) Now I'm stuck as to how to backup my data. I'll try "hard way" as described above and pray for the best.
 
Old 09-29-2011, 12:14 AM   #6
corp769
Guru
 
Registered: Apr 2005
Posts: 5,814

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
Quote:
Originally Posted by The Hound View Post
I see this is a very old thread, and I'm pretty much a noob, but there are legitimate reasons for wanting to do this. My VPS was hacked and I had to disable root login. (It is exponentially harder to guess both a user name and a password than just to guess root's password.) Now I'm stuck as to how to backup my data. I'll try "hard way" as described above and pray for the best.
Hello,

Please don't dig up old threads, especially thread-jacking someone elses thread. If you have a question, search the forums first for an answer, and if you have no luck, then by all means create a new thread.

Thanks,

Josh
 
  


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
running rsync as root msound Linux - Security 4 11-09-2005 11:16 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM
root permissions wass29 Slackware 3 05-10-2004 11:58 AM
permissions as root in X chlee Slackware 1 05-10-2003 11:32 PM
Anyway to use rsync ssh without allowing root access? ifm Linux - Security 0 06-12-2002 02:01 PM


All times are GMT -5. The time now is 09:12 AM.

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