Allow Specific User a Permission to Certain Folders

setfacl command

To give a user access to a certain folder in Linux you don't have to change the permissions globally for that folder, instead you can use 'setfacl' for that.

Give user mike a full access to dotsway folder:

[root@hostname ~]# setfacl -m u:mike:rwx /home/dotsway/

Check users and groups access permissions to certain folder:

[root@HOSTNAME ~]# getfacl /home/dotsway/
getfacl: Removing leading '/' from absolute path names
# file: home/dotsway
# owner: dotsway
# group: it
user::rwx
user:mike:rwx
group::---
mask::rwx
other::---

Remove user access from folder

setfacl -x u:mike /home/dotsway

 


Subscribe to
for video tutorials updates