if you are interested to contribute your LAB PROGRAM Please send mail to jkumaron@gmail.com

How to Setup ACL-Access Control List In Linux | Set Different Permission into Different User on Single File

ACl-ACCess control list the owner can set different permission on a single file for different user. Access control list provide a simple way of granting or denying access for a specified user or group on a single file.setfacl-set file access control list
First mount then set acl to the file
If you are not mount acl then it does not work. So you must mount acl
[root@studentwebsite fol]# mount -o acl,remount /
[root@studentwebsite fol]# touch file1
[root@studentwebsite fol]# chmod 777 file1
Give the full permission the file
[root@studentwebsite fol]# ls -l
total 8
-rwxrwxrwx 1 root root 0 Jun 14 18:23 file1
After giving the full permission for file1.
But we set Acl for user1 granted permission as read.
Give the full permission for user, group ,and other using chmod command.setfacl for user1 only for read permission. So user1 he can only read the file not do any other process like edit.
Syntax: setfacl syntax
[root@studentwebsite fol]# setfacl -m u:user1:r file1
Login to the user1
[root@studentwebsite ~]# su user1
[user1@studentwebsite root]$ cd fol/
[user1@studentwebsite fol]$ ls
[user1@studentwebsite fol]$ vi file1
if you can open the file but you can not edit the file

Related post