LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2009, 05:01 PM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
Permissions for rsync'ing


I have a folder that I want to rsync over to another server. This folder, /data/pictures, has photo: photo as the user:group on it with 774 as permissions. Well I have another account called backup on this server and my backup server which is where i want to copy the files to.

What's the best way to give backup user permission to /data/pictures. my /data/pictures is shared out in samba with a forced connection of photo: photo also, which i can't break that. In Windows I would just add the backup account at the pictures level and would be all set, not sure how to do it here other than a chmod 777, which isn't good because that folder is also a file share.
 
Old 10-23-2009, 05:32 PM   #2
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Hello,

If all files and perhaps folders as well under the path /data/pictures are 774... surely i'd be thinking all that needs to happen so your other user can decend into other directories pre-existing in /data/pictures would be to set
Code:
chmod -R 775 /data/pictures/*
However if there aren't any other directories within the path you have provided /data/pictures, then i cannot see a problem here and the backup user should already be able to see the files within /data/pictures.... This depends on the permissions of
Code:
ls -ld /data
ls -ld /data/pictures
However setting the 775 or even 774 means any user on the server can at least read the files within "/data/pictures/..."

Perhaps showing the output of:-
Code:
ls -ld /data
ls -ld /data/pictures
ls -l /data/pictures
Would help solve this all for sure.

You might also want to look into extended ACL's but that might be going to far for what your looking for.

Regards,
M
 
Old 10-23-2009, 05:37 PM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
There are indeed subfolders under pictures. it is 774 throughout. when I do the ls -l /data/pictures, it only shows me ?'s instead of the permissions, owner, group etc. The other two commands show accurate info.
 
Old 10-23-2009, 05:38 PM   #4
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
based on your 775 comment, so rsync needs read and execute permission at a minimum on the source folder?
 
Old 10-23-2009, 05:41 PM   #5
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Quote:
Originally Posted by rjo98 View Post
There are indeed subfolders under pictures. it is 774 throughout. when I do the ls -l /data/pictures, it only shows me ?'s instead of the permissions, owner, group etc. The other two commands show accurate info.
Ok thats great.. but to work out if the permissions are open enough to enable the backup user to access the files/folders for backup... and i assume your receiving an error when running the rsync relating to a permission problem? Therefore it would be useful to see the actual output of the commands.

One quick way would be to login as the backup user and check if that user can browse and see all the folders and files including going through sub directories as well and checking the backup user has permission enough to dive into them. Or if you get a permissions error... Otherwise i must be lost on your original question?!?!
Regards,
M
 
Old 10-23-2009, 05:44 PM   #6
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
I get readlink failed permission denied on each subfolder right under pictures. under my backup account, i cant even do a cd pictures to get into the directory. I guess I more just need to know how to give the backup account just enough permissions to get into there to rsync to another server, without messing up my photo account & group on there which are for the samba share of the /data/pictures
 
Old 10-23-2009, 05:44 PM   #7
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by rjo98 View Post
based on your 775 comment, so rsync needs read and execute permission at a minimum on the source folder?
The e[X]ecute bit on a directory allows someone to e[X]plore. That should help you remember.

Any directory containing files that need to be accessed by userx.groupy needs to have the execute bit set for userx, or groupy, or all (e.g.others).
 
Old 10-23-2009, 05:46 PM   #8
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
hi lutusp. so if i'm following what your saying, i need to chmod 775 to 1) keep my photo. photo in tact for my samba share and 2) give permission to that backup account which isn't in the photo group.

or would it be better to add backup into the photo group? can an account belong to more than one group at a time?
 
Old 10-23-2009, 05:49 PM   #9
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Yes... exactomondo...

Execute and explore... :-) nice method..

Anywho
Yes you could also add the backup user to the photo group... and then you could chmod -R 770 /data/pictures making it more secure still!!

And either way... it will be fine after that.
Cheers,
M

however chmoding -R 770 or whatever is only any good if new files beng uploaded are uploaded either with the correct permissions or forced to the correct permissions... but thats a whole other subject.

Last edited by helptonewbie; 10-23-2009 at 05:51 PM.
 
Old 10-23-2009, 05:50 PM   #10
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
my backup account is already in a group, will that mess it up if i add it to the photo group as well? can it belong to more than one group?
 
Old 10-23-2009, 05:52 PM   #11
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
You can have masses of users all in masses of different accounts. And you can delve even deeper when it comes to extended ACL's.. but as i said thats probably for another time :-)
 
Old 10-23-2009, 05:53 PM   #12
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Yeah, since I don't even know if a user can belong to multiple groups, I should probably leave extended ACLs for later!

I guess I'll just add backup into the photo group, as soon as I can google how to do that haha.

Thanks for the help everybody.
 
Old 10-23-2009, 06:00 PM   #13
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
:-)

Its relativly simple... but also depends on how you best want to learn and use linux... command line based or GUI.

It likely your GUI will already have some sort of User Management system in place to help with this... other wise your looking to probably use the usermod/moduser command (different depending on the distro..)

But probably something along the lines of:-
Code:
usermod -G photo -a backup
Meaning... depending on the distro and version of stuff (so to speak)
Modify user and -a (add/apend) to -G (group name) and then the username backup.

Hope it helps either way.
Regards,
 
Old 10-23-2009, 06:02 PM   #14
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
thanks, I'm using RHEL with CLI only.
 
Old 10-23-2009, 06:05 PM   #15
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Good for you.. I tend to use CLI day to day... its pretty cool! But some things are still easier left in a GUI.. so me thinks a nice mixture is not bad!

Then you should look at man usermod... or man moduser... and read up on that one, its been a while since i used red hat but i'm sure one of those will give you some info to go on.

Cheers,
M
 
  


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
File permissions v. directory permissions Completely Clueless Linux - Newbie 7 07-09-2009 09:33 AM
Permissions JSLayton Linux - Newbie 3 01-17-2006 01:57 PM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 01:00 PM
permission ... permissions .... permissions alaios Linux - General 1 05-31-2005 05:16 AM
getting a directory's permissions and creating a new one with the same permissions newbie1000101 Programming 1 04-10-2004 01:52 PM


All times are GMT -5. The time now is 12:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration