Linux Permissions Calculator - Unix File Mode Tool

Calculate and understand Linux/Unix file permissions with SUID, SGID, and sticky bit support. Generate chmod commands instantly.

Owner (user)

6

Group

4

Others (world)

4

⚡ Special Permissions

644
-rw-r--r--
$ chmod 644 filename

Understanding Linux File Permissions

In Linux and Unix systems, every file and directory has a set of permissions that control who can read, write, or execute it. This permission system is fundamental to Unix security, separating access rights among the file owner, the group, and all other users.

The Three Permission Categories

  • Owner (User): The user who created or owns the file.
  • Group: Users belonging to the file's associated group.
  • Others: All other users on the system.

Permission Types

  • Read (r = 4): View file contents or list directory.
  • Write (w = 2): Modify file or create/delete in directory.
  • Execute (x = 1): Run as program or cd into directory.

Special Permission Bits

  • SUID (4): When set on executable, runs as file owner. Example: /usr/bin/passwd
  • SGID (2): Runs as file group or new files inherit directory group.
  • Sticky (1): Only owner can delete files in directory. Example: /tmp

Common Permission Patterns

  • 755: rwxr-xr-x - Executables, directories
  • 644: rw-r--r-- - Regular files
  • 600: rw------- - Private files (SSH keys)
  • 1777: rwxrwxrwt - Shared directories with sticky bit
  • 4755: rwsr-xr-x - SUID executables

Security Best Practices

  • Never use 777 on production systems.
  • Audit SUID/SGID files regularly with find / -perm /6000.
  • Use group permissions instead of world-readable.
  • Set umask to 027 or 077 for new file defaults.