LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-10-2008, 07:55 PM   #1
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Non-root user set ownership for others...


Is there any way for a non-root account to set file ownership for other users? This would come in handy for backing up to remote systems where you don't want to enable remote root access.
 
Old 10-11-2008, 01:36 AM   #2
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Rep: Reputation: 32
I don't see how... except for maybe sudo?

I tried sudo - it works.
I was able to create a file as say user1 and change the owner to user2.
 
Old 10-11-2008, 04:01 PM   #3
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
If you create a directory then you should have the permission to change it's ownership, if someone else creates the directory then they have the permission, only root should really have permission to change other people's directories. So I'd stick with the above on the sudo one, you could look into group permissions however, directories don't always have to be limited to a single user. So if you need a directory to belong to a group you could assign a set of people to belong to the same group and then they should all be able to use it, alternatively if you want permissions over folders created by root you could add yourself to the same group as root if you have sudo or root but if you have them then you might as well just set yourself up with sudo as that's safer anyway.
 
Old 10-11-2008, 04:43 PM   #4
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Original Poster
Rep: Reputation: 67
what i'm trying to do is preserve ownership during backups
 
Old 10-11-2008, 05:34 PM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by Meson View Post
what i'm trying to do is preserve ownership during backups
Can't you give the users permission to run the backup program with root privileges using sudo?

Last edited by win32sux; 10-11-2008 at 05:43 PM.
 
Old 10-11-2008, 05:50 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Mineral, Virginia
Distribution: Debian 8
Posts: 7,891

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Quote:
Originally Posted by Meson View Post

what i'm trying to do is preserve ownership during backups
The cp command, the rsynch command, and the tar command all have options to preserve ownership. See:

man cp

man tar

man rsynch

---------------------
Steve Stites
 
Old 10-11-2008, 07:19 PM   #7
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by jailbait View Post
The cp command, the rsynch command, and the tar command all have options to preserve ownership
These commands need to be run as root to preserve ownership.
 
Old 10-11-2008, 07:20 PM   #8
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by win32sux View Post
Can't you give the users permission to run the backup program with root privileges using sudo?
I'd really like to create a dedicated backup user to oversee the backing up of other users' data.
 
Old 10-11-2008, 07:36 PM   #9
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by Meson View Post
I'd really like to create a dedicated backup user to oversee the backing up of other users' data.
So basically, with sudo, you would just give the privileges to that specific user then.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i mount a ext3 partition at startup and set its ownership to a user DarkPlexus Linux - Newbie 6 11-01-2007 10:50 AM
Partition ownership user or root drudge Linux - General 4 09-22-2007 11:29 AM
Proper way to set user as root access? SlowCoder Linux - Security 4 02-19-2007 08:03 PM
1:root vncserver: The USER environment variable is not set. Niceman2005 Linux - Software 1 05-24-2006 10:13 PM
How to set tcsh prompt: # for root and % for user? robson Linux - Newbie 1 10-12-2003 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration