Sunday, April 11, 2010

Linux: change users permission on folders

drwx-----x 57 test       admin 12288 2010-01-18 07:39         Test

The above is an example. Group admin has the ownership of folder Test, but doesn't have the read(r) or write(w) or execute(x) permission to that folder. To do that:

chmod -R g+rw Test

-R is for making changes recursivly
g  is for group
r   is for read permission
w  is for write permission

After executing the above command then do "ls -al" should see the info like:

drwxrwx--x 57 test       admin 12288 2010-01-18 07:39         Test

And only the user himself or users from admin group have the access to Test folder .

"chown test:admin Test/" is to change ownership of a folder to admin;
"chgrp admin *" is to change the ownership of all folders to admin;

0 Comments: