Managing ACL permissions.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 22 Dec 2015 22:29:09 +0200
changeset 1841 2aaf1f0297f9
parent 1840 da2130eaa115
child 1842 e66fcbaf99fa
Managing ACL permissions.
acl.rst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/acl.rst	Tue Dec 22 22:29:09 2015 +0200
@@ -0,0 +1,46 @@
+.. -*- coding: utf-8; -*-
+.. include:: HEADER.rst
+
+======
+ ACL.
+======
+.. contents::
+
+Managing ACL permissions.
+=========================
+
+Set permission::
+
+  $ sudo setfacl -m u:nobody:rwx ~/tmp/dir
+  $ sudo setfacl -m g:nogroup:rwx ~/tmp/dir
+
+Review permissions::
+
+  $ sudo getfacl ~/tmp/dir
+
+Remove specific permissions::
+
+  $ sudo setfacl -x u:test ~/tmp/dir
+
+Remove all ACL permissions::
+
+  $ sudo setfacl -b ~/tmp/dir
+
+Remove default ACL::
+
+  $ sudo setfacl -k ~/tmp/dir
+
+Backup and restore ACL::
+
+  $ sudo getfacl ~/tmp/dir >~/tmp/backup.acl
+  $ sudo setfacl --restore=~/tmp/backup.acl
+
+Add default ACL to directory to make ACL permission inheritance::
+
+  $ sudo setfacl -m -d u:nobody:rwx /srv/www
+  $ sudo setfacl -m u:nobody:rwx /srv/www
+
+.. NOTE:: default ACL is set only on directories and is applied only to
+          directory children. So you should explicitly add permission to
+          directory itself!
+