We use a hosting server of FreeBSD 10.3, where we don't have the authority to be a superuser. We use the server to run apache2 for web pages of our company. The previous administrator of our web pages appeared to set an ACL permission to a directory, but we want to remove it. Let us say the directory is called foobar.

Now the result of ls -al foobar is as follows:

drwxrwxr-x+   2 myuser  another_user   512 Nov 20  2013 foobar

And the permission is as follows:

[myuser@hosting_server]$ getfacl foobar
# file: foobar/
# owner: myuser
# group: another_user

Here we want to remove the ACL permission and the plus sign at the last of the permission list. Therefore, we did

setfacl -b foobar

It eliminated the special permission governed by the ACL, but didn't erase the plus sign+.

Our question is how can we erase the plus sign+ in the permission list, shown by 'ls -al foobar'?

  • getfacl indicates not ACLs. However ls is showing a +. Are you sure you are looking at the same file each time? (this is usually the reason for me) – ctrl-alt-delor Mar 18 '17 at 12:27
  • @richard yes, definitely the same file. – Taiki Bessho Mar 18 '17 at 12:54

Our problem was resolved by using:

setfacl -bn foobar

The point was we also had to remove the aclMask from the directory with an option -n... The man page of setfacl says as follows:

 -n      Do not recalculate the permissions associated with the ACL mask
         entry.  This option is not applicable to NFSv4 ACLs.

We're not sure why this option worked, but it did...

In case you get d????????? permission after the above solution, try chmod -R a+rX as two commented below.

  • This made my files: d????????? that's odd – JREAM Jan 3 '18 at 23:11
  • 1
    Update: This resolved it chmod -R a+rX the capital X – JREAM Jan 3 '18 at 23:48
  • @JREAM What Linux system do you use? – Taiki Bessho Jan 4 '18 at 10:29
  • I got that same d?????? thing with Ubuntu 16. Fixed with the above chmod. Weird. – TonyG Mar 4 '18 at 22:41

Odd... cannot reproduce:

ls -l | grep foobar
drwxr-xr-x+ 2 maulinglawns maulinglawns 4096 jan 24 14:25 foobar

setfacl -b foobar/
ls -l | grep foobar
drwxr-xr-x 2 maulinglawns maulinglawns 4096 jan 24 14:25 foobar

Unfortunately I don't have access to BSD to test right now.

System info:

Distributor ID: Debian
Description:    Debian GNU/Linux 8.7 (jessie)
Release:    8.7
Codename:   jessie
  • Indeed, I cannot reproduce on Ubuntu server 16.04.1... – Taiki Bessho Jan 24 '17 at 13:50
  • At last, I was able to delete the plus sign by setfacl -bn foobar but I don't know why the n option worked so. – Taiki Bessho Jan 25 '17 at 9:03

You should try using recursive option.

setfacl -R -b foobar

There is no need for -n option

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.