Remove FACL from a Folder/File Recursively

Remove FACL from a Folder/File Recursively

Remove FACL from a Folder/File Recursively

This blog assumes you followed our last blog on setting FACL with a LDAP group.

/linux-server/setfacl-using-ldap-groups/

login as root

setfacl --remove-all test.txt on the nas2 server

from here browse to the directory that you set the FACL on

Same screenshot: setfacl --remove-all test.txt in the facl directory

to remove the FACL from an individual file, issue the following command(modify the file name):

setfacl --remove-all test.txt removing the ACL from a single file

check to make sure it’s removed…

getfacl test.txt showing only user, group and other entries, ACL removed

now from here let’s remove FACL from a folder

setfacl --remove-all folder1 then getfacl folder1/ with no ACL entries

here we removed the FACL from the folder, but not the sub-contents, if you change into the folder, and look at the sub-contents, you still see the + for facl

cd folder1 and ls -la showing test2.txt still has the + ACL marker

as you can see the facl is still in place

getfacl test2.txt inside folder1 still showing group:HR:rwx and a mask

if we issue the above command with the -R option this will change this recursively

Same getfacl test2.txt output, the HR group ACL still in place

if we take a look inside of folder2, we can see the sub-contents that had the FACL no longer do.

ls -l in folder2 showing test3.txt without the + marker after setfacl -R

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

1 Comment

Leave a Reply

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