46

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
user::rwx
group::rwx
mask::rwx
other::r-x

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'?

2
  • 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) Mar 18, 2017 at 12:27
  • 1
    @richard yes, definitely the same file. Mar 18, 2017 at 12:54

2 Answers 2

49

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.

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

You should try using recursive option.

setfacl -R -b foobar

There is no need for -n option

4
  • -R is not supported on freebsd
    – Peter
    Apr 21, 2021 at 11:33
  • @Peter -R is supported on FreeBSD since 12.0-RELEASE (year 2018). Oct 5, 2021 at 0:15
  • OK i accept as answer, though then it amazes me some NAS products use such old versions of freebsd... Oh i allread gave a solution.. just let hope at some day the software i used to work with gets updated to support this.
    – Peter
    Oct 6, 2021 at 17:33
  • Works perfectly on Debian 11, no need for -n option or anything else Sep 6, 2022 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .