Un-setting or clearing ACLs

In trying to sort out my rsync restoration of data from a NAS I find that I cannot access some of the directories even when they are in my home directory and I am logged in.

There is mention in the directory Properties > Permissions that “This folder uses advanced permissions.”

I have no idea what this is about but could it be ACLs and how do I clear these settings so I can get on with what I am trying to do?

Grateful for any assistance from anybody who can help please.

Please open a terminal and go to the directory where one of these files or directories is located that you cannot access, then type;

getfacl fileordirectoryname

and copy paste the results here, encase them in CODE tags.

Interesting commands to know;
getfacl (show extended ACL’s)
setfacl (set ACLs)

setfacl -b fileordirectory (remove all extended ACLs from the file or directory)
setfacl -b -R directory (removes all extended ACLs from the directory and all files inside it, recursively)

However, I’m guessing the files and/or directories are owned by someone other than the account you are logged in as. You should be able to, as root, to chown (change ownership) these directories and files inside to your account.

For example:
chown -R miuku.users woot

Would change the directory woot and all files inside that directory to ownership; user:miuku group:users

Yes, those “Advanced Permissions” are ACLs.
Miuku already wrote how to change them, but you can also change them by clicking on “Advanced Permissions…” in Properties->Permissions.

But depending on the kind of permissions, you might have to do that as root (as Miuku wrote as well). So try with “Dolphin - Superuser Mode”.

PS: you can even change the owner of a file/directory in Properties->Permissions, if you run dolphin as root.

I’m too used to doing everything from the terminal :’(

Ok and thanks to Miuku and Wolfi. Terminal less ambiguous so here it is.
Background. RAID array drive is mounted on /data and it has subdirectory mastermedia. This is soft linked to mastermedia directory in my home directory /home/alastair/mastermedia. One of the offending directories is ~/mastermedia/Videos.

Here are the results of running ls -l and getfacl Videos from ~/mastermedia

alastair@x3400:~> cd mastermedia
alastair@x3400:~/mastermedia> ls -l
total 20
drw-rw-r--   51 alastair users  4096 Mar  8  2014 Music
drw-rw-r--  241 alastair users 12288 Mar  6 23:24 Photos
drw-rwxr--+ 153 alastair users  4096 Mar 11 22:32 Videos
alastair@x3400:~/mastermedia> getfacl Videos
# file: Videos
# owner: alastair
# group: users


As far as I am aware I am logged in as alastair so believe I should be able to open Videos directory or have I lost it altogether!!!

What’s the error if you try to cd into the Videos from the terminal?

The normal masked permissions look a bit weird, the directory lacks execute permissions.

setfacl -b Videos
chmod 775 Videos

And try entering the directory.

So it was not ACL problem but my ignorance. I have reset permissions to 775 and problem has gone.
Will do this recursively to all three multimedia directories and report back if I have further issues with rsync on that thread.
Meanwhile many thanks.

If you have a massive number of directories, you can set permissions in one swoop like this:

find targetdirectory -type d -exec chmod 755 {} \;

What it does is change the permissions for all directories under targetdirectory to rwx (user) r-x (group) r-x (all)

Don’t run that as root though as you might mess up your system if you chmod your / by accident :slight_smile:

Hi Miuku,
First another thank you for helping me sort out my system.

I note your “find” expression and have used it once before to delete unwanted files. One question is why is the “find” expression you give better than chmod with -R?

I am still in big trouble with trying to restore my mastermedia on main machine using rsync from NAS although the above fixed some problems. The log file runs to 6 MiB of mainly permissions denied. Will start new thread when I have clear idea what is going on.


It allows you to change permissions for directories or files only depending on you need.

You may have files that you don’t want to have execute bit set but .sh to have it for example. Chmod would change everything.

Type f would be all files but no dirs and type d directories but not files.

OK I appreciate that. Is there any way to discriminate between files within directories, ie hidden files for example?

Hidden files start with a period in the name.