chore: improve notes for permissions and ownership

This commit is contained in:
Michele Cereda
2024-02-12 01:00:00 +01:00
parent 1de538c65e
commit c8700866e0
2 changed files with 8 additions and 1 deletions

View File

@@ -17,9 +17,10 @@ BSD systems use NFSv4 ACLs by default in ZFS.
List of **NFSv4** [permission tags][syntax descriptions for setting acls] and [inheritance options][acl inheritance]. List of **NFSv4** [permission tags][syntax descriptions for setting acls] and [inheritance options][acl inheritance].
```sh ```sh
# Install the tool. # Install the tools.
apt install 'acl' apt install 'acl'
dnf install 'acl' dnf install 'acl'
zypper install 'acl'
# Show ACLs. # Show ACLs.
getfacl 'path/to/file' getfacl 'path/to/file'
@@ -127,11 +128,15 @@ setfacl -a '5' 'everyone@:r-x---a-R-c---:-d-----:allow' 'path/to/dir'
- [`setfacl` FreeBSD manual page][setfacl freebsd manual page] - [`setfacl` FreeBSD manual page][setfacl freebsd manual page]
- [Syntax descriptions for setting ACLs] - [Syntax descriptions for setting ACLs]
- [ACL inheritance] - [ACL inheritance]
- [`chmod`][chmod] for how to force new files to be owned by specific users or groups
<!-- <!--
References References
--> -->
<!-- Knowledge base -->
[chmod]: chmod.md
<!-- Others --> <!-- Others -->
[access control lists (acl) in linux]: https://www.geeksforgeeks.org/access-control-listsacl-linux/ [access control lists (acl) in linux]: https://www.geeksforgeeks.org/access-control-listsacl-linux/
[acl inheritance]: https://docs.oracle.com/cd/E19253-01/819-5461/gbaax/index.html [acl inheritance]: https://docs.oracle.com/cd/E19253-01/819-5461/gbaax/index.html

View File

@@ -9,10 +9,12 @@ chmod 'u=rw' "path/to/dir"
chmod 'go+x' "path/to/file" chmod 'go+x' "path/to/file"
# Set 'setuid' bit. # Set 'setuid' bit.
# Set on directories, forces new files to be owned by the same user by default.
chmod '04755' "path/to/dir" chmod '04755' "path/to/dir"
chmod 'u-s' "path/to/file" chmod 'u-s' "path/to/file"
# Set 'setgid' bit. # Set 'setgid' bit.
# Set on directories, forces new files to be owned by the same group by default.
chmod '02775' "path/to/dir" chmod '02775' "path/to/dir"
chmod 'g+s' "path/to/file" chmod 'g+s' "path/to/file"