Unix File Permissions for single user / Notes on POSIX ACL / setfacl

# setfacl -m user:userid:rwx filename / directory  ^ Syntax for applying permissions on file for single user.

* * The following STEPS are only required for “ext3 and ext4” on Linux kernels older than 2.6.38. All other filesystems that support ACLs enable them automatically.

# mount -o remount,acl filesystem  ^ This step is enough in most cases, if not, use next command as well.
# tune2fs -o acl /dev/partitionname

Example : User “ENDNOTE” to have RWX permission on “/prod/products” filesystem.

# setfacl -m user:endnote:rwx /prod/products    
setfacl: /prod/products: Operation not supported

* Before executing the below step we had error shown above

# mount -o remount,acl /prod/products      ^ Mounting the filesystem with ACL’s enabled.
# setfacl -m user:endnote:rwx /prod/products   ^ Giving user “endnote” required permission on /prod/products.

# getfacl /prod/products      ^ Checking ACL’s on directory “/prod/products”.
getfacl: Removing leading ‘/’ from absolute path names
# file: prod/products
# owner: isiprod
# group: prod

endnote:/prod/products# touch 123   ^ Making sure user “endnote” has access to /prod/products.
endnote:/prod/products> ls -l       ^ File is written and listed here.
total 16
-rw-r–r– 1 endnote users     0 2012-12-06 22:00 123
drwxrwx— 2 root    root  16384 2012-02-09 05:48 lost+found

Leave a Reply

Your email address will not be published. Required fields are marked *