Skip to content
Snippets Groups Projects
Commit 1a8cdb8c authored by Jan Siwiec's avatar Jan Siwiec
Browse files

Update standard-file-acl.md

parent fd2ce1cc
No related branches found
No related tags found
1 merge request!323extended-acls-storage-section
# Standard File ACL # Standard File ACL
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`.
```code
$ ls -l /dev/audio $ ls -l /dev/audio
crw-rw----+ 1 root audio 14, 4 nov. 9 12:49 /dev/audio crw-rw----+ 1 root audio 14, 4 nov. 9 12:49 /dev/audio
```
```code
$ getfacl /dev/audio $ getfacl /dev/audio
getfacl: Removing leading '/' from absolute path names getfacl: Removing leading '/' from absolute path names
# file: dev/audio # file: dev/audio
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment