Link to home
Start Free TrialLog in
Avatar of Hekkro
Hekkro

asked on

User permissions and rights on centos

How can I give an user the right to change file/folders' permissions and/or ownerships via console on CentOs 5.2





Avatar of fosiul01
fosiul01
Flag of United Kingdom of Great Britain and Northern Ireland image

you need to make the user owner of that file

to make the owner :

use chown

chown -R user  foldername   [ here -R for recursive ]

it wil change the owner ship

then give the read and write permision over that folder or file

by chmod  -R 755 folder name


http://www.cyberciti.biz/faq/how-linux-file-permissions-work/   : file permission  
how to use chown command to change owner shop

http://www.cyberciti.biz/faq/how-to-use-chmod-and-chown-command/   



you can use chgrp commadn to change group owner ship,

sorry too much link , but just have a read

http://www.tuxfiles.org/linuxhelp/fileowner.html

for chown and chgrp for changing file permission
Avatar of Hekkro
Hekkro

ASKER

Isn't there another way to do it

I'm giving someone access to my webserver, so he can fix some stuff ...I don't think is safe to make him the owner of the whole website.

Maybe create a "support" group with these rights and add this user to this group?

but then again I don't know much about it
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Why not use ACLs

By using ACLs you can give someone specific permissions regardless of Owner,Group and others

for example you can give Mr. Fix   rwx excusivly for Dirs or Files you want

To implement acls its fairly easy

setfacl -m u:john:rwx /var/www/html/test

This would give user John rwx on the file test without changing anything with chmod or owner or group
Do man setfacl and check examples at the end of the page

To view acl on a file

getfacl filename

Good Luck