rh124_advanced_permissions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rh124_advanced_permissions [2026/10/28 08:40] – [The sticky bit (primarily for directories)] rpjdayrh124_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 ''sudo'' command.
 +
 +===== Enterable but not readable directories =====
 +
 +<code>
 +$ chmod 0111 Poems
 +$ ls -ld Poems
 +$ ls Poems
 +$ cat Poems/twister
 +$ chmod 755 Poems
 +</code>
  
 ===== 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:
 </code> </code>
  
-===== 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 156: Line 170:
  
 Find all directories with the sticky bit: Find all directories with the sticky bit:
- 
-===== SGID setting on directories ===== 
- 
-This bit dictates that any files created in that directory take on the group of the group setting on the directory itself. 
  
 <code> <code>
Line 167: Line 177:
 /sys/fs/bpf /sys/fs/bpf
 /tmp /tmp
-/tmp/.X11-unix +... snip ...
-/tmp/.ICE-unix +
-/tmp/.XIM-unix +
-/tmp/.font-unix +
-/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-dbus-broker.service-rm2smd/tmp +
-/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-chronyd.service-KYCF1b/tmp +
-/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-irqbalance.service-Xglrdp/tmp +
-/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-systemd-logind.service-dLohsJ/tmp +
-/var/tmp +
-/var/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-dbus-broker.service-lkWgGX/tmp +
-/var/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-chronyd.service-n9CB6t/tmp +
-/var/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-irqbalance.service-WjxydR/tmp +
-/var/tmp/systemd-private-f5f7d1e9279c4beebbdb24085e4c3d82-systemd-logind.service-LeW18R/tmp+
 $ $
 </code> </code>
Line 196: Line 194:
 </code> </code>
  
 +===== 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.
 +
 +<code>
 +$ find / -type d -perm -2000 2> /dev/null
 +</code>
 +
 +How to add to a directory:
 +
 +<code>
 +$ chmod g+s <directory name>
 +</code>
 +
 +**NOTE**: There is no value for the SUID bit on directories.
 ===== Ask Google ===== ===== Ask Google =====
  
  • rh124_advanced_permissions.1793176855.txt.gz
  • Last modified: 2026/10/28 08:40
  • by rpjday