Overview of Special Permission Bits

In addition to standard Read, Write, and Execute bits, Linux supports three special permission modes. These bits occupy the leading 4th digit in 4-digit octal notation.

4000

Setuid (Set User ID)

When set on an executable file, the program executes with the privileges of the file owner, rather than the privileges of the user running the command.

Real-world Example: /usr/bin/passwd has Setuid enabled so regular users can temporarily run as root to update their own encrypted password in /etc/shadow.
Symbolic representation: rws-r-xr-x (lowercase s if execute bit is set; uppercase S if execute is missing).
2000

Setgid (Set Group ID)

On executable files, the process runs with the file group's permissions. On directories, new files created inside automatically inherit the directory's group owner.

Real-world Example: Shared team project folders. Applying Setgid ensures all newly created sub-files remain accessible to group members.
Symbolic representation: rwxr-sr-x (lowercase s if execute bit is set).
1000

Sticky Bit

When set on a directory, users can only delete or rename files that they own (or root), even if the directory is world-writable.

Real-world Example: The public /tmp folder (permissions 1777 or drwxrwxrwt). Everyone can create temporary files, but no user can delete another user's temp file.
Symbolic representation: rwxrwxrwt (lowercase t if execute bit is set).

How to Apply Special Bits in Terminal

# Set Setuid (4000) + 755 = 4755chmod 4755 /usr/local/bin/custom_toolchmod u+s /usr/local/bin/custom_tool# Set Setgid (2000) + 775 = 2775 on shared folderchmod 2775 /var/www/shared_projectchmod g+s /var/www/shared_project# Set Sticky Bit (1000) + 777 = 1777 on temp folderchmod 1777 /var/tmp/shared_uploadschmod +t /var/tmp/shared_uploads

Toggle Special Bits Live in the Calculator

Check Setuid, Setgid, or Sticky checkboxes to see updated 4-digit octal output.

Test Special Bits →