File permissions explained
Every file and folder on the server has file permissions. They determine who may read, change or execute the content. You change them in File Manager of your control panel, with an FTP client or via SSH.
Every hosting package runs in a container of its own. Changing file permissions does not give other customers access to your files.
What the digits mean
Our servers run Linux. There, file permissions are written as a three-digit code: the first digit applies to the owner, the second to the group and the third to everyone else. Each digit is the sum of read (4), write (2) and execute (1):
| digit | meaning | notation |
|---|---|---|
| 0 | no permissions | --- |
| 1 | execute only | --x |
| 2 | write only | -w- |
| 3 | write and execute | -wx |
| 4 | read only | r-- |
| 5 | read and execute | r-x |
| 6 | read and write | rw- |
| 7 | read, write and execute | rwx |
Which permissions to choose
The standard is 644 for files and 755 for folders. If a script has to write to a folder or file via PHP, 775 (folder) or 664 (file) is sometimes needed.
| code | permissions | use |
|---|---|---|
644 | owner read and write; group and others read | files (standard) |
664 | owner and group read and write; others read | files, only when needed |
666 | everyone read and write | not recommended |
755 | owner everything; group and others read and execute | folders (standard) |
775 | owner and group everything; others read and execute | folders, only when needed |
777 | everyone everything | not recommended |
In File Manager of DirectAdmin, the UID/GID column shows which user and group own a file or folder; in Plesk they are in the User and Group columns.
Changing permissions
- In your control panel: in File Manager of DirectAdmin (Web Hosting and Reseller Hosting) or Plesk (WordPress Hosting); see Managing files.
- With an FTP client, such as FileZilla.
- Via SSH or the Terminal in DirectAdmin, with the commands below; see Connecting via SSH.
Enter a domain name, such as yourdomain.nl.
For a single file or a single folder in DirectAdmin, with the full path (with WordPress Hosting in Plesk your website is in httpdocs instead of domains/yourdomain.nl/public_html):
chmod 644 ~/domains/yourdomain.nl/public_html/filename.php
chmod 755 ~/domains/yourdomain.nl/public_html/foldernameTo reset a whole folder with everything in it, use the commands in Resetting file permissions on your hosting package.
Related articles
Thank you for your feedback.

