Search code examples
linuxubuntupermissionsaclsuse

Access denied on folders for users though they have the rwx permission on SUSE Linux


I have a folder /PPI/production/PDF_plan/ on SLES 12 SP1 system. Please find the details below.

SERVER1:~ # getfacl /PPI/production/PDF_plan/
getfacl: Removing leading '/' from absolute path names
# file: PPI/production/PDF_plan/
# owner: ppi
# group: ppi
user::rwx
group::r-x
other::r-x

Then I gave rwx permission for a group called AdCNC as below

SERVER1:~ # setfacl -Rdm g:AdCNC:rwx /PPI/production/PDF_plan/
SERVER1:~ #

ncaps1 is a user under AdCNC group.

SERVER1:~ # grep ncaps1 /etc/group
AdCNC:x:1005:ncaps1
SERVER1:~ #

Please find below the getfacl output on this folder now. It clearly shows that AdCNC group now has the rwx permission on this folder.

SERVER1:~ #
SERVER1:~ # getfacl /PPI/production/PDF_plan/
getfacl: Removing leading '/' from absolute path names
# file: PPI/production/PDF_plan/
# owner: ppi
# group: ppi
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:AdCNC:rwx
default:mask::rwx
default:other::r-x

But When I try to create a folder or write a file on /PPI/production/PDF_plan/ I am getting 'access denied' error message.

SERVER1:~ # su ncaps1
ncaps1@SERVER1:/root> cp /Ran/ExistingConfiguration/smb.conf /PPI/production/PDF_plan/
cp: cannot create regular file ‘/PPI/production/PDF_plan/smb.conf’: Permission denied
ncaps1@SERVER1:/root> mkdir /PPI/production/PDF_plan/TestFolder 
mkdir: cannot create directory ‘/PPI/production/PDF_plan/TestFolder’: Permission denied
ncaps1@SERVER1:/root>

Please help me to fix this problem. Thank you


Solution

  • default:group:AdCNC:rwx is not permission of AdCNC in this folder, it means that the permission "rwx" fro AdCNC for sub folders which will be created in future.

    Let's run (without -d option):

    setfacl -Rm g:AdCNC:rwx /PPI/production/PDF_plan/