Chmod Calculator
Toggle permissions to get the numeric (octal) and symbolic notation. Used with the Linux chmod command.
Numeric (Octal)
644
Symbolic
-rw-r--r--
Command
chmod 644 filenameCommon Permission Patterns
755Owner: rwx, Group: r-x, Other: r-x — Directories, executables644Owner: rw-, Group: r--, Other: r-- — Regular files, configs600Owner: rw-, Group: ---, Other: --- — SSH private keys, secrets700Owner: rwx, Group: ---, Other: --- — Private scripts, .ssh directory777Owner: rwx, Group: rwx, Other: rwx — AVOID in production (security risk)440Owner: r--, Group: r--, Other: --- — sudoers filesWhat is a Chmod Calculator?
The chmod (change mode) command is one of the most frequently used commands in Linux and Unix-based operating systems for managing file and directory permissions. It uses an octal (numeric) notation system where each digit represents the permissions for the owner, group, and others respectively. Each digit is the sum of its component permissions: read (4), write (2), and execute (1). For example, chmod 755 gives the owner full access while allowing the group and others to only read and execute the file.
This chmod calculator is used by DevOps engineers, system administrators, and developers who need to quickly determine the correct permission values for files, directories, SSH keys, and configuration files. Common use cases include setting secure permissions for deployment scripts, configuring web server document roots, securing private keys, and ensuring configuration files are not world-readable. Understanding file permissions is essential for maintaining system security and is a fundamental skill for anyone working with Linux servers or containers.
Frequently Asked Questions
What does chmod 777 mean?
Chmod 777 grants read, write, and execute permissions to the owner, the group, and all other users. This means anyone on the system can read, modify, or execute the file. While convenient for testing, using 777 in production is a serious security risk and should be avoided. Instead, use the minimum permissions necessary for the file to function correctly.
What is the safest permission for SSH keys?
SSH private keys should be set to chmod 600 (read and write for the owner only). The .ssh directory itself should be chmod 700. OpenSSH will refuse to use a private key if it has permissions that are too open. Public keys (.pub files) can be chmod 644 since they are meant to be shared.
How to chmod recursively?
Use the -R flag to apply permissions recursively to a directory and all its contents: chmod -R 755 /path/to/directory. However, be cautious—applying the same permissions to both files and directories is often not appropriate. A common pattern is to use find to set directories to 755 and files to 644 separately: find /path -type d -exec chmod 755 {} \; and find /path -type f -exec chmod 644 {} \;.