How to Use the Chmod Calculator
The chmod calculator helps you understand and set Unix/Linux file permissions quickly. Whether you are a system administrator, web developer, or DevOps engineer, understanding file permissions is essential for security and proper system configuration.
Step 1: Set permissions using checkboxes. Click the checkboxes for read (r), write (w), and execute (x) for each category: owner, group, and others. The numeric and symbolic representations update instantly as you toggle permissions.
Step 2: Or enter a numeric value. Type a three-digit octal number (like 755 or 644) in the numeric input field. The checkboxes and symbolic representation update automatically to reflect the permission setting.
Step 3: Copy the chmod command. The tool shows the complete chmod command ready to paste into your terminal. Copy the numeric or symbolic notation and use it directly in your shell commands.
Understanding Unix File Permissions
Unix and Linux file permissions are a fundamental security mechanism that controls who can read, write, and execute files. Every file and directory has three sets of permissions: owner (the user who created the file), group (users sharing the file's group), and others (everyone else). Each set independently controls read, write, and execute access.
The numeric (octal) system represents each permission set as a single digit from 0 to 7. Read is valued at 4, write at 2, and execute at 1. The digit is the sum of the granted permissions. For example, read+write+execute = 4+2+1 = 7, read+execute = 4+1 = 5, and read-only = 4. Common permission combinations include 755 for executable files, 644 for regular files, and 600 for private files.
Common Permission Patterns
Web server files (644). Standard web files like HTML, CSS, JavaScript, and images should use 644 permissions. The owner can read and write, while group and others can only read. This prevents other users from modifying your web content while allowing the web server to serve the files.
Web server directories (755). Directories need the execute permission for traversal. The 755 permission allows the owner full access while letting the web server and other users read and traverse directories to serve content.
Private configuration (600). Files containing passwords, API keys, database credentials, or SSH keys should use 600 permissions. Only the owner can read and write these files, preventing any other user on the system from accessing sensitive data.
Shared executables (755). Shell scripts, compiled programs, and CGI scripts need execute permission to run. The 755 permission lets the owner modify the script while allowing all users to run it. For scripts that should not be modified, 555 is more restrictive.