Free tool · no signup
Chmod calculator and permissions checker
Tick the boxes to get the chmod number and the rwx string, or type a number to see what it means. Paste an ls -l listing to find files anyone can change, and get the commands for a WordPress site.
By the Bug Circuit security team · Last updated
Pick the permissions
| Read | Write | Execute | |
|---|---|---|---|
| Owner | |||
| Group | |||
| Everyone else |
- Number
- 755
- Symbolic
- rwxr-xr-x
Owner can read, write, run. Group can read, run. Everyone else can read, run.
chmod 755 filename
How it works
How the number works
Every file has three sets of permissions: for the owner, for the group and for everyone else. Each set is a sum: read is 4, write is 2 and execute is 1. So 7 is read, write and execute (4+2+1), 6 is read and write, 5 is read and execute, and 4 is read only. The three digits of 755 are the owner (7), the group (5) and everyone else (5). The same permission written as letters is rwxr-xr-x.
A fourth leading digit holds three special bits: setuid (4) and setgid (2) make a program run with its owner's or group's rights, and the sticky bit (1) on a folder means only a file's owner can delete it, which is how /tmp works. Websites rarely need any of them.
Permissions for a website
The usual safe values are 755 for folders (the web server must be able to enter them) and 644 for files. Files that hold secrets, such as wp-config.php or an .env file, should be tighter: 640 or 600, so other accounts on the server cannot read your database password. WordPress's own hardening guide suggests 440 or 400 for wp-config.php where your host allows it, as long as the web server can still read it.
The mistake that causes real damage is 777 (or 666 for a file). On shared hosting, other accounts, or a script running as a different user, can then rewrite your files, and one infected site can spread to its neighbours. If an upload or update fails with the right permissions, the cause is almost always file ownership: ask your host to fix the owner instead of opening the permissions.
Checking a whole folder
Run ls -la in your site folder and paste the output into the checker. It reads the permissions of each entry and flags files and folders anyone can write to, setuid files and secrets that other users can read, and prints the chmod command that fixes each one. The listing is read in your browser and goes nowhere.
Worked examples
Reading 755 and 644
Two common values.
755 = rwxr-xr-x owner: read, write, run | group: read, run | others: read, run 644 = rw-r--r-- owner: read, write | group: read | others: read
755 suits folders and programs, 644 suits ordinary files such as pages and images.
Set WordPress permissions
WordPress installed in /var/www/html.
find /var/www/html -type d -exec chmod 755 {} ;
find /var/www/html -type f -exec chmod 644 {} ;
chmod 640 /var/www/html/wp-config.phpThe first two commands reset every folder and file. The third tightens the config file.
A listing the checker flags
-rw-rw-rw- 1 www-data www-data 3107 Oct 22 12:00 wp-config.php
wp-config.php: file anyone can change (666) fix: chmod 640 wp-config.php
Anyone with access to the server could read the database password and change the file.
Frequently asked questions
What does chmod 777 do?
What permissions should WordPress files have?
What is the difference between 644 and 640?
How do I change permissions on all files in a folder?
What does the leading d or - in ls -l mean?
What is the sticky bit?
Why do my uploads fail with 755 and 644?
Keep reading
See what attackers see, for free
Run the free passive check on your website. No login, no impact on your site, results in seconds.
Ready for the full manual audit? See pricing