Tuesday, June 4, 2013

Linux file and folder permision

To get and change file and folder permission we use setfact and getfacl


+ to display file/folder permissio:

 root@darapc:~# getfacl glog
# file: glog
# owner: root
# group: root
user::rw-
group::r--
other::r--



+ to modify permission on file glog and allow user admin write and read

root@darapc:~# setfacl -m "admin:rw" glog

root@darapc:~# getfacl glog
# file: glog
# owner: root
# group: root
user::rw-
user:admin:rw-
group::r--
mask::rw-
other::r--




+ to modify permission on folder and sub-folder we use -R (recursive):

root@darapc:~# setfacl -R -m "admin:rw" glogFolder

root@darapc:~# getfacl glogFolder
# file: glogFolder
# owner: root
# group: root
user::rwx
user:admin:rw-
group::r--
mask::rw-
other::r--


No comments:

Post a Comment