Step-by-step
- Decide what the file or directory is for, such as a web page, a script or a private key.
- Open the Chmod Calculator and tick Read, Write and Execute for the owner, group and others, or type the number.
- Copy the command, for example chmod 755 filename.
- Run it on the file and check the result with ls -l.
- Test that the application or user still has the access it needs.
How the numbers work
Each permission has a value: read is 4, write is 2 and execute is 1. Add them for each class. Read and write is 6, read and execute is 5, and all three is 7. So 755 means the owner can read, write and execute, while the group and others can read and execute.
Common modes
644 is typical for regular files: the owner can edit, everyone else can read. 755 suits directories and scripts that others need to run. 600 keeps a file private to its owner, which SSH requires for private keys. 700 is common for the .ssh directory.
Directories need execute
A directory needs the execute permission before anyone can enter it or reach the files inside. A directory with read but no execute lets people list names but not open anything.
Changing many files safely
Avoid chmod -R 755 on a whole tree, because it makes ordinary files executable. Set directories and files separately: find . -type d -exec chmod 755 {} + and find . -type f -exec chmod 644 {} +. Avoid 777 on shared or production servers, since it lets every user modify the file.
Finish the task with DevUtilityKits
Use the relevant online utility, check the result, and continue with your development workflow.
Open Chmod Calculator →