LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-23-2009, 10:33 PM   #1
KStolen
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Simple permissions problem


I have a simple (i think) permissions problem I need help with.

I have a folder, lets call it media.
The owner of this folder is bob. The group owner is mediagroup.
I am joe. Both bob and joe are members of mediagroup.

I want to grant anyone in mediagroup to have rwxrwxr-- permissions to all the files in this folder. But I also want them to have those permissions to all future files in that folder.

I've tried using umask 002 from bobs account but it didn't seem to work. As joe, I still couldn't delete files in the folder.

What's the best way to set up what I want to do?
 
Old 04-23-2009, 11:02 PM   #2
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
chmod -R command. Consult man chmod for details.
 
Old 04-23-2009, 11:42 PM   #3
Libu
Member
 
Registered: Oct 2003
Location: Chennai
Distribution: Slackware 12.1
Posts: 165

Rep: Reputation: 36
chmod command will not help here. For the current files it will work, but for any new file that you create it will not.

If I remember right even setting the umask may not help as the when a file is created, the default permissions are 644.

I think your best bet would be ACL's. I have not done this on Linux but it works perfectly on Solaris. On Solaris there were two commands "getfacl" and "setfacl". I'm sure there must be linux alternatives (or maybe the exact same commands).
 
Old 04-23-2009, 11:47 PM   #4
Libu
Member
 
Registered: Oct 2003
Location: Chennai
Distribution: Slackware 12.1
Posts: 165

Rep: Reputation: 36
Well the commands are present on RedHat.

The setfacl command I used
Quote:
setfacl -m d:u::rwx,d:g::rwx,d:r-x,d:m:rw- media/
The comma seperated options are the permissions for owner,group,others and mask.

The man page is pretty descriptive. Check it out.

the part where the smiley is a "colon o"

Last edited by Libu; 04-23-2009 at 11:49 PM. Reason: automatic smiley
 
Old 04-24-2009, 01:09 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
I hope this folder isn't in your home directory. You don't want other users to be able to cd into your home directory. Supposing that it is something like /home/media then you can use facl's as Libu suggested.

setfacl -m g:mediagroup:rwx /home/media
seftacl -m d:g:mediagroup:rw /home/media

Since mediagroup already has group rights, the first line isn't necessary. The second one is the default permission that files created in it will inherit.

Another option is to set the guid bit for the /home/media directory. New files and folders in it will inherit group ownership. On some Unix systems, setting the suid bit for folders will do the same for the owner, but not in Linux.
 
Old 04-24-2009, 01:19 AM   #6
Libu
Member
 
Registered: Oct 2003
Location: Chennai
Distribution: Slackware 12.1
Posts: 165

Rep: Reputation: 36
Quote:
seftacl -m d:g:mediagroup:rw /home/media
In solaris, when you are setting default permissions (d: ), you need to specify the default permisions for all elements (user,group,other and mask). I'm not sure whether the behaviour is different in linux ?

Quote:
Another option is to set the guid bit for the /home/media directory. New files and folders in it will inherit group ownership. On some Unix systems, setting the suid bit for folders will do the same for the owner, but not in Linux.
Setting guid did not work for me (if I remember right.). What happened was that all users in the group can create the files in the directory, but the created files would have the default permissions (644), implying that other user will not be able to edit the file created by others in the group.

Last edited by Libu; 04-24-2009 at 01:20 AM.
 
  


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 Questions / SIMPLE HELP ME! vonedaddy Linux - Newbie 6 12-21-2007 05:59 AM
Mounting permissions for simple user Panagiotis_IOA Slackware 7 03-15-2006 07:50 PM
simple permissions question hollywoodb Linux - Newbie 13 10-16-2003 03:47 PM
simple questions about permissions chrismiceli Linux - General 6 06-15-2003 01:00 PM
Is there a simple way to give all permissions frontier1 Linux - General 3 02-28-2003 09:55 PM


All times are GMT -5. The time now is 08:42 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