Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| rh124_advanced_permissions [2026/10/23 09:25] – [The setgid bit] rpjday | rh124_advanced_permissions [2026/10/28 14:01] (current) – [SGID bit for directories] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== RH124 Advanced Permissions ====== | ====== RH124 Advanced Permissions ====== | ||
| + | |||
| + | ===== NOTE ===== | ||
| + | |||
| + | If you're running these commands as a non-root user, do not use the '' | ||
| + | |||
| + | ===== Enterable but not readable directories ===== | ||
| + | |||
| + | < | ||
| + | $ chmod 0111 Poems | ||
| + | $ ls -ld Poems | ||
| + | $ ls Poems | ||
| + | $ cat Poems/ | ||
| + | $ chmod 755 Poems | ||
| + | </ | ||
| ===== Strange permissions ===== | ===== Strange permissions ===== | ||
| Line 67: | Line 81: | ||
| so a full octal representation for any file permissions would be octal 7777 (regular settings are sometimes written 0755 or 0644 or whatever). | so a full octal representation for any file permissions would be octal 7777 (regular settings are sometimes written 0755 or 0644 or whatever). | ||
| - | ===== The setuid bit ===== | + | ===== The setuid bit for executable files ===== |
| This bit means that when you run this binary executable, it will **retain** its ownership: | This bit means that when you run this binary executable, it will **retain** its ownership: | ||
| Line 110: | Line 124: | ||
| </ | </ | ||
| - | ===== The setgid bit ===== | + | ===== The setgid bit for executable files ===== |
| No longer as popular but similar to above: | No longer as popular but similar to above: | ||
| Line 163: | Line 177: | ||
| /sys/fs/bpf | /sys/fs/bpf | ||
| /tmp | /tmp | ||
| - | /tmp/.X11-unix | + | ... snip ... |
| - | /tmp/.ICE-unix | + | |
| - | /tmp/.XIM-unix | + | |
| - | /tmp/.font-unix | + | |
| - | / | + | |
| - | / | + | |
| - | / | + | |
| - | / | + | |
| - | /var/tmp | + | |
| - | / | + | |
| - | / | + | |
| - | / | + | |
| - | / | + | |
| $ | $ | ||
| </ | </ | ||
| Line 183: | Line 185: | ||
| drwxrwxrwt. 2 root root 40 Oct 23 02:00 /dev/mqueue | drwxrwxrwt. 2 root root 40 Oct 23 02:00 /dev/mqueue | ||
| $ | $ | ||
| + | </ | ||
| Setting/ | Setting/ | ||
| Line 190: | Line 193: | ||
| $ chmod -t < | $ chmod -t < | ||
| </ | </ | ||
| + | |||
| + | ===== SGID bit for directories ===== | ||
| + | |||
| + | This identifies directories such that, when new files or directories are created within that directory, they take on the same group affiliation of the directory itself, regardless of who does the creation. | ||
| + | |||
| + | < | ||
| + | $ find / -type d -perm -2000 2> /dev/null | ||
| + | </ | ||
| + | |||
| + | How to add to a directory: | ||
| + | |||
| + | < | ||
| + | $ chmod g+s < | ||
| + | </ | ||
| + | |||
| + | **NOTE**: There is no value for the SUID bit on directories. | ||
| + | ===== Ask Google ===== | ||
| + | |||
| + | Google: Does EX200 exam ask about setuid and setgid and sticky bit? | ||
| + | |||
| + | //" | ||