Skip to content
ENExplore Calculators

SUID SGID Sticky Bit Calculator

Work out suid sgid sticky bit instantly with clear inputs, formula shown and shareable results.

About SUID SGID Sticky Bit Calculator

A fourth leading octal digit carries setuid (4), setgid (2) and the sticky bit (1). setuid makes a binary run as its owner, which is how passwd can edit the shadow file. setgid on a directory makes new files inherit the directory's group, which is what makes shared project directories work. The sticky bit on /tmp stops users deleting each other's files.

Formula

Special bits

mode = special digit (4 setuid + 2 setgid + 1 sticky) followed by the three standard digits

Worked example

With the default values below, SUID SGID Sticky Bit Calculator returns Four-digit octal mode of 2775. Change any input above and every figure here is recalculated in your browser.

Inputs used

Special bits to setone of None (0), Sticky bit only (1), setgid only (2), setuid only (4), setuid + setgid (6), setgid + sticky (3)
setgid only (2)
Base permission modeaccepts 0–777
775

Results

Four-digit octal mode
2775
Command
chmod 2775 <path>
Behaviour
on a directory, new files inherit the group; on a binary, runs with the file group
Security consideration
No setuid risk from this mode

Step by step

  1. 1Values used
  2. 2Special bits
  3. 3Four-digit octal mode= 2775
  4. 4Command= chmod 2775 <path>
  5. 5Behaviour= on a directory, new files inherit the group; on a binary, runs with the file group
  6. 6Security consideration= No setuid risk from this mode

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why are setuid binaries dangerous?

Any flaw in one becomes a root escalation. Modern practice replaces them with fine-grained Linux capabilities, so a program gets only the specific privilege it needs.

What does setgid do on a directory?

New files and subdirectories inherit the directory's group rather than the creating user's primary group, which is essential for collaborative directories.

SUID SGID Sticky Bit Calculator | Calcrivo