What is chmod?
chmod(short for “change mode”) is a Unix/Linux command used to change the access permissions of files and directories. Every file on a Linux system has three sets of permissions — one for the owner (the user who created the file), one for the group (users who share group membership), and one for others (everyone else on the system).
Each set can grant three types of access: read (view file contents or list directory contents), write (modify the file or add/remove files in a directory), and execute (run the file as a program or enter a directory). Permissions are critical for system security and are one of the first things every Linux administrator learns.
Permission Values
Each permission type has a numeric (octal) value. The values are added together to produce the final permission number for each set (owner, group, others):
| Permission | Numeric Value | Symbol | Description |
|---|---|---|---|
| Read | 4 | r | View file contents or list directory |
| Write | 2 | w | Modify file or add/remove in directory |
| Execute | 1 | x | Run as program or enter directory |
| None | 0 | - | No permission granted |
For example, 7 means read (4) + write (2) + execute (1) = full access. 5 means read (4) + execute (1) = read and execute but no write.
Common Permissions Reference
| Numeric | Symbolic | Typical Use |
|---|---|---|
| 777 | rwxrwxrwx | Full access for everyone (avoid in production) |
| 755 | rwxr-xr-x | Executables, public directories, web server root |
| 750 | rwxr-x--- | Programs accessible to group members only |
| 700 | rwx------ | Private executables, home directories |
| 644 | rw-r--r-- | Regular files, config files, HTML/CSS/JS |
| 640 | rw-r----- | Config files readable by group (e.g., www-data) |
| 600 | rw------- | SSH keys, private config, sensitive data |
| 444 | r--r--r-- | Read-only files for all users |
| 400 | r-------- | Owner-only read (e.g., SSL certificates) |
Symbolic vs Numeric Notation
There are two ways to specify permissions with chmod:
| Feature | Numeric (Octal) | Symbolic |
|---|---|---|
| Syntax | chmod 755 file | chmod u=rwx,g=rx,o=rx file |
| Sets all at once | Yes (always) | Optional (can modify one set) |
| Relative changes | No | Yes (chmod g+w file) |
| Readability | Compact, less intuitive | Verbose, self-documenting |
| Common in scripts | Very common | Less common |
| Learning curve | Must memorize values | Letters are self-explanatory |
Numeric notation is the most commonly used method because it's concise and sets all permissions at once. Symbolic notation is useful when you need to change only specific permissions without affecting others, for example chmod g+w file adds write permission for the group without changing owner or others permissions.
Frequently Asked Questions
chmod 777 gives full read, write, and execute permissions to the owner, group, and all other users. This means anyone on the system can read, modify, and execute the file. It is generally considered a security risk and should be avoided in production environments.
chmod 755 gives the owner full access (read, write, execute) and gives group and others read and execute access. It is used for executable files and directories. chmod 644 gives the owner read and write access and gives group and others read-only access. It is used for regular non-executable files like HTML, CSS, and config files.
SSH private keys should be set to 600 (owner read/write only) or 400 (owner read only). SSH will refuse to use a private key if other users can read it. The .ssh directory itself should be 700, and the authorized_keys file should be 600.
Use the -R flag: chmod -R 755 /path/to/directory. This changes permissions for the directory and all files and subdirectories inside it. Be careful with recursive chmod — you often want different permissions for files (644) and directories (755). You can use find to apply them separately: find /path -type d -exec chmod 755 {} \; and find /path -type f -exec chmod 644 {} \;
Numeric (octal) notation like chmod 755 sets all permissions at once using numbers 0-7. Symbolic notation like chmod u+x uses letters (u=user/owner, g=group, o=others, a=all) and operators (+=add, -=remove, ==set) to modify specific permissions. Numeric is more common in scripts and documentation; symbolic is useful for making targeted changes.
You also need execute permission on every directory in the file’s path. For example, to read /home/user/docs/file.txt, you need execute permission on /, /home, /home/user, and /home/user/docs. Execute permission on a directory means you can enter and traverse it.
Yes, this tool is completely safe. It runs 100% in your browser using JavaScript. No data is sent to any server. There is nothing to upload — the calculator simply flips bits based on your checkbox selections and computes the result locally.