Access control list (ACL) provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disk resource. For more information, see the [wikipedia][1] page.
Access control list (ACL) provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disk resource.
## Show ACL
## Show ACL
...
@@ -8,40 +8,59 @@ To show permissions, use:
...
@@ -8,40 +8,59 @@ To show permissions, use:
```code
```code
# getfacl <file/dir>
# getfacl <file/dir>
Examples
```
Set all permissions for user johnny to file named abc:
### Examples
Set all permissions for user John to file named abc:
```code
# setfacl -m "u:John:rwx" abc
```
# setfacl -m "u:johnny:rwx" abc
Check permissions:
Check permissions:
```code
# getfacl abc
# getfacl abc
# file: abc
# file: abc
# owner: someone
# owner: someone
# group: someone
# group: someone
user::rw-
user::rw-
user:johnny:rwx
user:John:rwx
group::r--
group::r--
mask::rwx
mask::rwx
other::r--
other::r--
Change permissions for user johnny:
```
Change permissions for user John:
```code
# setfacl -m "u:John:r-x" abc
```
# setfacl -m "u:johnny:r-x" abc
Check permissions:
Check permissions:
```code
# getfacl abc
# getfacl abc
# file: abc
# file: abc
# owner: someone
# owner: someone
# group: someone
# group: someone
user::rw-
user::rw-
user:johnny:r-x
user:John:r-x
group::r--
group::r--
mask::r-x
mask::r-x
other::r--
other::r--
```
Remove all ACL entries:
Remove all ACL entries:
```code
# setfacl -b abc
# setfacl -b abc
```
Check permissions:
Check permissions:
```code
# getfacl abc
# getfacl abc
# file: abc
# file: abc
# owner: someone
# owner: someone
...
@@ -49,11 +68,18 @@ Check permissions:
...
@@ -49,11 +68,18 @@ Check permissions:
user::rw-
user::rw-
group::r--
group::r--
other::r--
other::r--
Output of ls command
```
You will notice that there is an ACL for a given file because it will exhibit a + (plus sign) after its Unix permissions in the output of ls -l.
## Output of ls command
You will notice that there is an ACL for a given file because it will exhibit `+` after its Unix permissions in the output of `ls -l`.