How to use setfacl to give no access to “other” users

aclpermissions

The command setfacl -dm g::rwx mydir sets permissions for groups to read-write-execute. I'd like to run a similar command such that other users (i.e. not the owner) have no access whatsoever, but setfacl -dm o:: mydir complains that option -m is incomplete. What is the proper way of expressing this?

Best Answer

An empty permission set can be represented with -:

setfacl -dm o::- mydir

This doesn't appear to be documented, so I don't know how portable it is. However, the documentation does mention that they can be specified as an octal digit (4 r, 2 w, 1 x, as in chmod), so:

setfacl -dm o::0 mydir
Related Question