Permissions - CentOS system (Red Had Enterprise)

How can I give read/write permissions on some files and foders to two users from different groups on a CentOS system (Red Had Enterprise)?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use Access Control Lists to give access to multiple groups. There is a guide at this url:

so running

setfacl -m g:mygroup:rwx /tmp/myfolder

would let give any member  of  'mygroup' rwx rights on  /tmp/myfolder.

Deepak KosarajuDevOps EngineerCommented:
u have to use ACL for this task
u have command call

setfacl -m u:username:<permissions> dirname

example: setfacl -m u:test1:rw testdir

to delete acl u can use
setfacl -x u:username dirname

to display the current acl on directory r file u can use
getfacl dirname (or) filename

To set default Acl on Directoy r file u can use following command

this is like default acl rule on directory for r and execute access on share dir.
setfacl -m d:o:rx dirname

on Redhat EL 4 and 3 r Centos 3 r 4 u have to mount the filesystem with ACL enabled like
mount -t ext3 -o acl <device-name> <partition>
example:mount -t ext3 -o acl /dev/VolGroup00/LogVol02 /work

On Redhat EL5 r Centos EL 5 by default filesystems are enabled with ACL.

gud luck
vetrixicodeAuthor Commented:
I run this command (setfacl -m u:www:rw 200801), but displays message "Operation not supported".
what the problem ?
[root@linuxserver1 test]# setfacl -m u:www:rw 200801                  
setfacl: 200801: Operation not supported

Open in new window

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Deepak KosarajuDevOps EngineerCommented:
which version of linux r u using Redhat EL4 r 5
vetrixicodeAuthor Commented:
Is the version 3
Deepak KosarajuDevOps EngineerCommented:
u have to enable acl at the filesystem level by default in EL3 and 4 ACL is not enabled at filesystem level use  the following command

 Redhat EL 4 and 3 r Centos 3 r 4 u have to mount the filesystem with ACL enabled like
mount -t ext3 -o acl <device-name> <partition>
example:mount -t ext3 -o acl /dev/VolGroup00/LogVol02 /work

and add this to rc.local file to make setting permanent
after mounting u can use setfacl on enabled filesystem( since i sad filesystem it implies files under it

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.