Linux permissions
chmod permissions explained
What each common chmod number allows for the owner, the group and everyone else, which one to use for files and folders, and how to set it over SSH or in cPanel.
Open the chmod calculatorCommon permissions
-
755
rwxr-xr-xFolders and scripts on web servers: you change them, everyone else can open folders and run scripts. The default for directories on most hosts. -
644
rw-r--r--Normal files on web servers: PHP files, HTML, CSS, JavaScript and images. You change them, everyone can read them. -
777
rwxrwxrwxNothing on a live server. Everyone (every account and every process) can read, change and run it. Fix permission errors with the right owner and 755/775 instead. -
775
rwxrwxr-xFolders shared with your group, for example Laravel's storage/ and bootstrap/cache/ when the web server runs in your group. -
600
rw-------Private files: SSH keys, .env, credentials. Only the owner can read and change them (SSH refuses keys that are more open). -
700
rwx------Private folders such as ~/.ssh and your own scripts: only you can open, change or run them. -
664
rw-rw-r--Files you and your group both edit, for example uploads and logs written by the web server user in your group. -
400
r--------Read-only private files, such as an AWS .pem key: only the owner can read them. -
444
r--r--r--Read-only files everyone can read, such as a locked wp-config.php or a generated file you don't want edited. -
750
rwxr-x---Folders and scripts only your group should reach, for example deploy scripts shared with a deploy user. -
640
rw-r-----Config files the web server group must read but others must not, for example a .env file read by the www-data group. -
660
rw-rw----Files shared with your group that others must not read, such as a group-readable database socket or log. -
770
rwxrwx---Private shared folders: owner and group work in them, everyone else is locked out. -
744
rwxr--r--Scripts only you run, while others can still read them. -
711
rwx--x--xHome or parent folders others must pass through (to reach public_html) without listing what is inside. -
666
rw-rw-rw-Files everyone may change, such as /dev/null. On a website, use 664 or 644 instead. -
766
rwxrw-rw-Rarely right: everyone can change the file but only the owner can run it. Usually a sign that 664 or 644 was meant. -
555
r-xr-xr-xRead-only folders and scripts that everyone can open or run but nobody changes. -
500
r-x------Read-only private folders or scripts: only the owner can read or run them, and nobody can change them. -
440
r--r-----Read-only files for the owner and group, such as /etc/sudoers.