Chmod Permission Calculator

Visual file permission selector

bash — 80x24
$ chmod 755 file.txt
$ ls -l file.txt
-rwxr-xr-x 1 user group 1234 Jun 26 10:00 file.txt
Owner (User)
7
Read
r
+4
Write
w
+2
Execute
x
+1
Group
5
Read
r
+4
Write
w
+2
Execute
x
+1
Others
5
Read
r
+4
Write
w
+2
Execute
x
+1
Octal Permission
755
rwxr-xr-x
chmod 755 file.txt

Common Permission Presets

777
Full Access
755
Default Dir
644
Default File
600
Private File
700
Private Dir
666
All Read/Write
444
Read Only
555
Read/Execute

Reverse: Octal to Permissions

rwxr-xr-x

Quick Tips

Security First

Never use 777 on production servers. It gives everyone full access

Files vs Directories

Use 644 for files, 755 for directories as a safe default

Sensitive Files

Use 600 for private keys, passwords, and sensitive config files

Recursive

Use -R flag for recursive changes: chmod -R 755 /path/to/dir

Common Chmod Values Reference

Most commonly used permission values with their symbolic notation and typical use cases

Octal Symbolic Owner Group Others Use Case
777 rwxrwxrwx rwx rwx rwx ⚠️ Full access (avoid in production)
755 rwxr-xr-x rwx r-x r-x ✅ Default directory permissions
700 rwx------ rwx --- --- 🔒 Private directory (owner only)
644 rw-r--r-- rw- r-- r-- ✅ Default file permissions
600 rw------- rw- --- --- 🔒 Private file (owner only)
666 rw-rw-rw- rw- rw- rw- 📝 All can read/write (no execute)
444 r--r--r-- r-- r-- r-- 📖 Read-only for everyone
555 r-xr-xr-x r-x r-x r-x ▶️ Read & execute (no write)
750 rwxr-x--- rwx r-x --- 👥 Owner + group access
770 rwxrwx--- rwx rwx --- 👥 Owner + group full access
640 rw-r----- rw- r-- --- 📄 Owner write, group read
400 r-------- r-- --- --- 🔐 SSH private key (recommended)

Permission Values Explained

Read (4)

Allows viewing file contents or listing directory contents

Write (2)

Allows modifying file or adding/removing files in directory

Execute (1)

Allows running file as program or entering directory

Octal Math

Add values: r(4) + w(2) + x(1) = 7 (full access)

Understanding Linux File Permissions

What is Chmod?

chmod (change mode) is a Linux/Unix command used to change file and directory permissions. It controls who can read, write, and execute files on the system.

Three User Categories

Every file has permissions for three categories of users:

  • Owner (User): The user who created the file
  • Group: Users in the file's group
  • Others: Everyone else on the system

Three Permission Types

Each category can have three types of permissions:

  • Read (r, value 4): View file contents or list directory
  • Write (w, value 2): Modify file or add/remove files in directory
  • Execute (x, value 1): Run file as program or enter directory

Octal Notation

Permissions are represented as a 3-digit octal number (0-7 for each digit):

  • First digit: Owner permissions
  • Second digit: Group permissions
  • Third digit: Others permissions
  • Example: 755 = Owner(7) + Group(5) + Others(5)

Calculating Octal Values

Add the values of enabled permissions:

  • rwx = 4 + 2 + 1 = 7 (full access)
  • r-x = 4 + 0 + 1 = 5 (read + execute)
  • rw- = 4 + 2 + 0 = 6 (read + write)
  • r-- = 4 + 0 + 0 = 4 (read only)
  • --- = 0 + 0 + 0 = 0 (no access)

Command Examples

  • chmod 755 file.txt - Set rwxr-xr-x
  • chmod 644 file.txt - Set rw-r--r--
  • chmod -R 755 /dir - Recursive directory change
  • chmod u+x file.sh - Add execute for owner

Security Best Practices

  • Never use 777 on production servers
  • Use 644 for regular files as default
  • Use 755 for directories as default
  • Use 600 for sensitive files (keys, passwords)
  • Use 400 for SSH private keys (read-only for owner)

Advanced Tips

Principle of Least Privilege

Give users only the minimum permissions they need to do their job

Directory vs File

Directories need execute (x) to be entered, files need it to be run

Check Current

Use ls -l to view current permissions

Symbolic Mode

Use chmod u+x to add permissions without changing others

Understanding Linux File Permissions

Linux file permissions control who can access files and what they can do with them. The chmod command is essential for system administrators and developers to manage file security. Understanding octal notation (like 755, 644) is crucial for working with Linux systems.

Permission Values

Each permission has a numeric value:

Common Permission Patterns

Most commonly used permission values:

Security Best Practices

Follow these security guidelines:

Using This Calculator

Follow these steps:

More Computer & Developer Tools

Explore more computer and developer calculators in our collection, including Unix Timestamp Calculator, Binary/Hex Converter, and PX to REM Converter!