Rechercher dans ce blog

Affichage des articles dont le libellé est acl. Afficher tous les articles
Affichage des articles dont le libellé est acl. Afficher tous les articles

lundi 25 mai 2026

ACL - Access Control List manipulation

ACL - Access Control List manipulation

Each file has one ACL, containing an ordered list of entries. Each entry refers to a user or group, and grants or denies a set of permissions.

Filesystem object permissions

deleteDelete the item. Deletion can be granted by either this permission on an object or the delete_child right on the containing directory.
readattrRead an objects basic attributes. This is implicitly granted if the object can be looked up and not explicitly denied.
writeattrWrite an object’s basic attributes.
readextattrRead extended attributes.
writeextattrWrite extended attributes.
readsecurityRead an object’s extended security information (ACL).
writesecurityWrite an object’s security information (ownership, mode,ACL).
chownChange an object’s ownership.

Directory permissions:

listList entries.
searchLook up files by name.
add_fileAdd a file.
add_subdirectoryAdd a subdirectory.
delete_childDelete a contained object. See the file delete permission above.

Non-directory filesystem object permissions:

readOpen for reading.
writeOpen for writing.
appendOpen for writing, but in a fashion that only allows writes into areas of the file not previously written.
executeExecute the file as a script or program.

Directory ACL inheritance permissions:

file_inheritInherit to files.
directory_inheritInherit to directories.
limit_inheritFor subdirectory inheritance; this causes the directory_inherit flag to be cleared, preventing further subdirectories from also inheriting the entry.
only_inheritThe entry is inherited by created items but not considered when processing the ACL.

In cases where a user and a group exist with the same name, the user/group name can be prefixed with "user:" or "group:" in order to specify the type of name.

ACL Examples

Use ls -le to view the effect of all changes.

$ chmod +a "admin allow read,readattr,readextattr,readsecurity" MyDemoDirectory
$ chmod +a "admin allow write" myfile.txt
$ chmod +a "guest deny read" myfile.txt
$ chmod +a "admin allow delete" myfile.txt
$ chmod +ai "others allow read" myfile.txt
$ chmod +a# 2 "others deny read" myfile.txt
$ chmod -a# 1 myfile.txt
$ chmod -a "admin allow write" myfile.txt
$ chmod =a# 1 "admin allow write,chown"

Clear All ACLs:
$ sudo chmod -RN /path/to/folder

Disable Apple Remote Desktop by Revoking execute rights:
$ cd /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/
$ sudo ls -l
$ sudo chmod u-s ARDAgent

mercredi 9 décembre 2015

exemples acl chmod Mac OS X et extended attributs xattr manipulations

Exemples acl chmod Mac OS X et extended attributs xattr manipulations

Examples acl chmod Mac OS X

# ls -le
-rw-r--r--+ 1 juser wheel 0 Apr 28 14:06 file1
# chmod +a "admin allow write" file1
# ls -le
-rw-r--r--+ 1 juser wheel 0 Apr 28 14:06 file1
owner: juser
1: admin allow write
# chmod +a "guest deny read" file1
# ls -le
-rw-r--r--+ 1 juser wheel 0 Apr 28 14:06 file1
owner: juser
1: guest deny read
2: admin allow write
# chmod +a "admin allow delete" file1
# ls -le
-rw-r--r--+ 1 juser wheel 0 Apr 28 14:06 file1
owner: juser
1: guest deny read
2: admin allow write,delete



Use the xattr command. You can inspect the extended attributes:

$ xattr s.7z
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine
and use the -d option to delete one extended attribute:
$ xattr -d com.apple.quarantine s.7z
$ xattr s.7z
com.apple.metadata:kMDItemWhereFroms
you can also use the -c option to remove all extended attributes:

$ xattr -c s.7z
$ xattr s.7z