QA
Intermediate LevelLinux Commands & SysAdmin

What are Special Permissions: SUID (4000), SGID (2000), and Sticky Bit (1000)?

❓ Interview Prompt: Explain special permissions: SUID (chmod u+s / 4000), SGID (chmod g+s / 2000), Sticky Bit (chmod +t / 1000 on /tmp), and security implications.

Beyond standard rwx permissions, Linux provides three Special Permission Bits:

1
SUID (Set User ID - 4000 / 'u+s'): Executable runs with the file owner's privileges rather than the executing user (e.g. '/usr/bin/passwd').
2
SGID (Set Group ID - 2000 / 'g+s'): Executable runs with file group privileges. On directories, new files inherit parent directory group!
3
Sticky Bit (1000 / '+t'): On directories (e.g. '/tmp'), prevents users from deleting or renaming files owned by others!

Code Implementation Example

bash
# Apply Sticky Bit to shared directory (+t)
sudo chmod +t /var/shared-tmp/

# Apply SGID to directory so new files inherit group
sudo chmod g+s /var/www/project/

# Inspect special permissions (t = sticky, s = SUID/SGID)
ls -ld /tmp /var/www/project/
💡Configuring Sticky Bit and SGID special permissions on directories.
🎯 Interview Key Takeaway

Use SGID (g+s) on shared group folders so new files inherit group ownership, and Sticky Bit (+t) on public temporary folders.

#Special Permissions#SUID#SGID#Sticky Bit#Intermediate
Back to all Linux Commands & SysAdmin Questions→

More Linux Commands & SysAdmin Interview Questions

Beginner LevelLinux Commands & SysAdmin

How do Linux File Permissions (chmod, chown, chgrp) work in Octal and Symbolic notation?

Beginner LevelLinux Commands & SysAdmin

What is the Linux Filesystem Hierarchy Standard (/bin, /etc, /var, /usr, /opt, /tmp)?

Beginner LevelLinux Commands & SysAdmin

What are File Descriptors (0=stdin, 1=stdout, 2=stderr) and Redirection (>, >>, 2>&1)?