Skip to content
xYnta
Go to websitexynta.com
Search
EN

File permissions explained

Updated on

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):

digitmeaningnotation
0no permissions---
1execute only--x
2write only-w-
3write and execute-wx
4read onlyr--
5read and executer-x
6read and writerw-
7read, write and executerwx

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.

codepermissionsuse
644owner read and write; group and others readfiles (standard)
664owner and group read and write; others readfiles, only when needed
666everyone read and writenot recommended
755owner everything; group and others read and executefolders (standard)
775owner and group everything; others read and executefolders, only when needed
777everyone everythingnot 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.

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/foldername

To reset a whole folder with everything in it, use the commands in Resetting file permissions on your hosting package.

Related articles