Linux und ACL - Access Control Lists

Aus Laub-Home Wiki

ACLs erweitern das standard Linux Filesystemrechte Konzept.

Klassische Berechtigung

Ausgabe von ls -l einer Datei:

-rw-r--r-- 1 root root      12 Mar 15 13:15 testfile

Hier steht -rw-r--r-- für owner (-rw), group (r--) und other (r--). Rechte setzten:

chmod u+rwx g+rwx o+rw
chmod 775 test.file
-rwxrwxr-x 1 root root       0 Mar 15 13:48 test.file
chmod u+s test.file
chmod 4777 test.file
-rwsrwxr-x 1 root root       0 Mar 15 13:48 test.file
chmod g+s test.file
chmod 2777 test.file
-rwxrwsr-x 1 root root       0 Mar 15 13:48 test.file

ACL Fileberechtigung

Dateisysteme müssen in der fstab mit dem Parameter acl gemountet werden. /etc/fstab

/dev/sdb1      /mnt/root       ext4    acl,defaults        0       0

Unter Debian/Ubuntu Linux muss das Paket ACL nachinstalliert werden um die ACLs zu verwenden:

aptitude install acl

ACL Berechtigungen von Dateien oder Ordnern abfragen:

getfacl test.file

ACLs Setzten, zum Beispiel eine Gruppe hinzufügen mit rwx Recht:

setfacl -m group:tomcat:rwx test.file

Will man einen Benutzer hinzufügen mit rwx:

setfacl -m user:user1:rwx test.file