How to Calculate Linux Permissions
Generate chmod commands in four simple steps:
Check Matrix Boxes
Toggle Read, Write, and Execute for Owner, Group, and Others.
Use Quick Presets
Click 755 (Web Dir), 644 (File), or 600 (Private Key) presets.
Set Filename & Flags
Enter your target path and toggle Recursive (-R) if modifying subfolders.
Copy Command
Paste the generated `chmod` command directly into your terminal or SSH session.
Key Features & System Security
Dual Octal & Symbolic Sync
Real-time bi-directional mapping between octal integers (`755`) and symbolic flags (`-rwxr-xr-x`).
Special Flag Support
Calculate Setuid (4000), Setgid (2000), and Sticky Bit (1000) 4-digit octal permissions.
Server Hardening Presets
Quick templates for NGINX/Apache web files (`644`), directories (`755`), and SSH keys (`600`).
Command Line Builder
Custom filename and recursive `-R` flag options ready to copy directly into bash/zsh.
100% In-Browser Privacy
Zero network requests; all calculations evaluate instantaneously in browser memory.
1-Click Clipboard Copy
Smooth clipboard copy with non-blocking toast notifications.
Understanding Linux File Permissions & Octal Arithmetic
In Unix and Linux systems, file security is enforced through an authorization bitmask. Each file is owned by a specific User and Group. Setting incorrect permissions (like reckless `chmod 777` on production servers) allows any unprivileged system user or vulnerable web script to execute malicious binaries or overwrite system files.
Nextgen Astra Chmod Calculator provides a visual, foolproof reference to verify file security policies before applying changes on production servers.
Comparison Matrix
| Permission | Octal | Symbolic | Recommended Use Case |
|---|---|---|---|
| Standard Web Directory | 755 | drwxr-xr-x | Public web folders, document roots |
| Standard Web File | 644 | -rw-r--r-- | PHP, HTML, CSS, images |
| SSH Private Key | 600 / 400 | -rw------- | id_rsa, .env files, certificates |
| Executable Script | 700 | -rwx------ | Private bash scripts, cron jobs |
Frequently Asked Questions
?How does the Linux Chmod calculation matrix work?
Linux permissions assign numeric values to three actions: Read ($r=4$), Write ($w=2$), and Execute ($x=1$). Summing these values generates an octal digit (0 to 7) for each entity: Owner, Group, and Public/Others.
?What is the standard permission for web files and directories?
Directories typically use `chmod 755` (`rwxr-xr-x`, allowing the web server to enter and list contents), while PHP/HTML files use `chmod 644` (`rw-r--r--`, readable by all, writable only by owner).
?What permissions should be used for SSH private keys (`id_rsa`)?
SSH requires strict permissions: `chmod 600` (`rw-------`) or `chmod 400` (`r--------`), restricting read/write access exclusively to the owner.
?What are Special Permissions (Setuid, Setgid, Sticky Bit)?
Setuid (4000) executes with owner privileges; Setgid (2000) inherits group ownership for new files; Sticky Bit (1000) prevents non-owners from deleting files in shared directories (like `/tmp`).
?Can I generate recursive commands for entire directory trees?
Yes! Check the 'Recursive (-R)' toggle to generate commands like `chmod -R 755 /var/www/html`.