Linux Chmod Permissions Calculator
Interactively calculate Linux file and directory permissions in octal (numeric) and symbolic formats. Generate ready-to-use terminal commands with instant presets and special bit support.
File Permissions Matrix
| Permission Class | Read (r = 4) | Write (w = 2) | Execute (x = 1) |
|---|---|---|---|
| Owner (User)7 | |||
| Group5 | |||
| Others (Public)5 |
Generated Linux Chmod Command
chmod 755 filename.txtPopular Permission Presets
Comprehensive Guide to Unix & Linux File Permission Architecture
In Unix-like operating systems (including GNU/Linux distributions like Ubuntu, Debian, Red Hat, CentOS, Arch, and macOS), file system security is anchored around the Discretionary Access Control (DAC) model. Every single file, directory, symlink, device node, and named pipe stored on an ext4, XFS, Btrfs, or ZFS volume is tagged with metadata in its file system inode that governs who may inspect, modify, or execute its contents.
This model compartmentalizes all operating system users into three distinct permission categories:
1. Owner (User - u)
The individual user account that created the file or was assigned ownership via the chown command. The owner typically retains the authority to modify the file's permission flags and grant or restrict rights to other entities.
2. Group (g)
A collection of user accounts managed in /etc/group that share common collaborative responsibilities (for example, the developers group, docker group, or web server daemon group www-data).
3. Others (Public - o)
Any user or process on the machine that is neither the file owner nor a member of the designated group. Permissions assigned to 'Others' represent the baseline public access level on the server.
The Mathematics of Octal Notation: How Binary Bits Sum to Permissions
The Unix kernel views permissions as a 9-bit binary array (or 12-bit when including special flags). Each triplet of bits maps directly to a single base-8 (octal) digit from 0 to 7:
Permits viewing file content or listing filenames inside a folder.
Permits modifying, appending, truncating, or creating new files in a directory.
Permits executing binaries/scripts or traversing into a folder path.
By combining these flags:
• 7 (4 + 2 + 1) = Read, Write, and Execute (rwx)
• 6 (4 + 2 + 0) = Read and Write (rw-)
• 5 (4 + 0 + 1) = Read and Execute (r-x)
• 4 (4 + 0 + 0) = Read Only (r--)
• 0 (0 + 0 + 0) = No Permissions (---)
Production Web Server & Security Best Practices
Security misconfigurations are among the top OWASP vulnerabilities in web infrastructure. Apply these battle-tested standards:
WordPress & CMS Deployments
Never grant 777 to wp-content/uploads even if installation plugins complain about upload write failures. Instead, retain 755 on directories and 644 on files, while transferring ownership to the web daemon:
sudo chown -R www-data:www-data /var/www/html
find /var/www/html -type d -exec chmod 755 {} +
find /var/www/html -type f -exec chmod 644 {} +SSH Keys & Cloud Server Credentials
OpenSSH client rejects private keys if they are accessible by group members or others, failing with the warning "Permissions are too open":
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa ~/.ssh/id_ed25519
chmod 644 ~/.ssh/authorized_keys ~/.ssh/*.pubLinux File Permissions Reference Table
| Octal | Symbolic | Binary | Description | Best For |
|---|---|---|---|---|
777 | rwxrwxrwx | 111 111 111 | Read, write, & execute for everyone (Dangerous) | Temporary local sandbox testing only |
755 | rwxr-xr-x | 111 101 101 | Owner full; group and others read/execute | Web directories, CGI scripts, executables |
644 | rw-r--r-- | 110 100 100 | Owner read/write; others read-only | Standard web files (.html, .css, .js, .png) |
600 | rw------- | 110 000 000 | Only owner can read & write | Private SSH keys (id_rsa, .pem), credentials |
700 | rwx------ | 111 000 000 | Only owner can enter & modify | Personal user folders, ~/.ssh directory |
444 | r--r--r-- | 100 100 100 | Read-only for all classes | Protected archives, read-only logs |
Frequently Asked Questions
Explore Related Tools
Hand-picked utilities and calculators related to this tool.
