Is it possible to give two users different permissions on the same directory? I want to use it for ftp: userFull gets R+W and userLim gets only Read, depending on who logs on. Im getting stuck on the ownership versus group rights… (I use CentOS+Directadmin and Proftpd)
So the following is what I want if it's possible at all:
/home/myDir - userFull - read & write
/home/myDir - userLim - read only
Best Answer
Yes, by using ACL - Access Control Lists. (if not avail, install via
yum install acl
)Before you start setting ACL, you initially need to enable ACL support for filesystem, for doing it manually use:
But you need to enter this command every time you boot the system. To avoid this, you can enable acl when the filesystem is mounted, by using fstab.
Eg.
/etc/fstab
(for your home directory), if you are using ext4 file system:For more information go to redhat documentation link.
By
setfacl
you can assign permission like::After that by
getfacl
, you can view the permissions:For more info, please visit CentOS documentation page.