5

I have a directory with strange permissions ( drwxr-xr-x+ ) - trailing ( + ) as 11th character, which seems to force all the files and subdirectories to assume rwxrwxrwx permissions, Following is the permissions.

drwxr-x---+  3 root root 4096 Dec 22 15:33 directory

I want to get rid of this trailing ( + ). I have tried following .

chmod 755 directory/
chmod a-x directory/
chmod u=rwx,g=rw,o=x directory/

I have tried following as well :

sudo chmod u=rwx,g=rx,o-x,u-s,g-s    directory/

Any help will be appreciated . Thanks - I am stuck .

Gurdyal
  • 161
  • 2
  • 2
  • 11
  • It means the file/directory has an Access Control List. See https://unix.stackexchange.com/questions/92071/file-permissions-mode-ending-in-or – Barmar Jul 18 '17 at 08:17
  • @jww actually this is related to programming ( as I am writing a shell script ), all the files or sub-directories being created are always having permissions 777. This is creating problems for me and I found that this trailing ( + ) seems to be an issue. but anyway may be I should ask it in unix exchange. Thanks much – Gurdyal Jul 18 '17 at 08:29
  • @barmar thank you, I'll take a look at it. – Gurdyal Jul 18 '17 at 08:29
  • 1
    How many times does this question need to be asked on the Stack Exchange network? [What does the trailing “+” mean in file permission bits in Linux?](https://superuser.com/q/510562/173513), [What is the “+” mark at the end of file description?](https://apple.stackexchange.com/q/26776/83961), [What does a + mean at the end of the permissions from ls -l?](https://serverfault.com/q/227852/145545), [+ or @ mark after running 'ls -al'](https://unix.stackexchange.com/q/1646/56041), [What does the dot mean at the end of `-rw-r--r--`?](https://superuser.com/q/230559/173513), etc. – jww Jul 18 '17 at 08:45
  • @jww apologies, I tried to search but couldnt get any of them :) – Gurdyal Jul 18 '17 at 08:51
  • @jww this came up as the first result in my google search as well. To downvoters: vote to close as duplicate instead. – Scott Ritchie Nov 14 '17 at 23:30

3 Answers3

11

The trailing + signify that ACL, Access Control List, is set on the directory.

You can use getfacl to get the details

getfacl directory

Following output is from getfacl Codespace which have ACL set by setfacl -m u:umesh:rw Codespace. Here setfacl is giving rw permission to Codespace directory for user umesh.

# file: Codespace/
# owner: root
# group: root
user::rwx
user:umesh:rw-
group::r-x
mask::rwx
other::r-x

and we can remove the ACL using setfacl, for example, for the above sample

setfacl -x u:umesh Codespace/

More details at man setfacl and man getfacl

dlmeetei
  • 9,905
  • 3
  • 31
  • 38
4

The + when listing a file will signify extended permissions on the file. These permissions will be set with access control lists. If you run "getfacl directory" you will see the extended permissions on the directory.

Depending on how the access control lists are set up, to remove, run:

setfacl -x u:username directory

and/or

setfacl -x g:groupname directory 

To remove the + from the listing, you may also need to run:

setfacl -x m directory
Raman Sailopal
  • 12,320
  • 2
  • 11
  • 18
-1

setfacl -b directory

Remove all extended ACL entries. The base ACL entries of the owner, group and others are retained.