InfraBench / system / chmod-umask

Linux chmod & umask Permission Calculator

Interactive POSIX octal / symbolic permissions, SUID / SGID / Sticky bits, and umask simulator

Presets:
Octal Mode
0755
short: 755
Symbolic (File / Dir)
-rwxr-xr-x
dir: drwxr-xr-x
Special Bits
None
standard POSIX mode
umask Effective Modes
0644 (-rw-r--r--)
0755 (drwxr-xr-x)
Permission Bit Matrix
ScopeRead (4)Write (2)Execute (1)Special Bit
Owner (u)
Group (g)
Other (o)
Generated Commands
Octal chmod

          
Symbolic chmod

          

Linux Permissions, Special Bits & umask Reference

Unix and Linux permissions map three permission bits—Read (4), Write (2), and Execute (1)—across Owner (u), Group (g), and Other (o), plus an optional leading octal digit for special execution and directory semantics.

  • Secrets & SSH Keys (0600): OpenSSH refuses private keys readable by group or other. Always set chmod 600 ~/.ssh/id_ed25519 and chmod 600 .env for API tokens or webhooks.
  • SGID on Shared Directories (2775): Setting SGID on a directory forces newly created files inside it to inherit the directory's group ownership rather than the creator's primary group.
  • Sticky Bit (1777): Used on world-writable directories like /tmp so users can only delete or rename files they own.
  • How umask Works: The kernel masks out bits from the base creation mode (0666 for files, 0777 for directories) via bitwise AND-NOT: effective = base & ~umask. Hardened servers often use umask 0027 so files default to 0640 (no world read).

Frequently Asked Questions

Why is chmod 777 dangerous on web or application servers?

0777 grants every local user and compromised service account full read, write, and execute rights. On shared hosts or container volumes, an attacker can overwrite scripts or inject payloads executed by privileged processes.

What is the difference between lowercase s and uppercase S in ls -l?

Lowercase s (e.g. rwsr-xr-x) means SUID/SGID is set AND the underlying execute bit is enabled. Uppercase S (rwSr-xr-x) means SUID/SGID is set WITHOUT the execute bit.