Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Understanding CHMOD (file permissions on a server)

Update 08/07/2026

This guide details CHMOD (short for change mode), which allows you to change the access permissions of a file or directory.

 

Modify FTP permissions

The permissions (see this other Wikipedia guide) available for each user/group are as follows:

  • read: grants the right to list (also requires execute permission) and read within a directory and/or read a file
  • write: grants the right to create, modify, rename, and delete files and/or directories
  • execute: for a directory: grants the right to access it to read its subdirectories -> For a file: grants the right to execute it if it is a program or script, for example.
  • set uid (?): on an executable file, this will cause it to run with the permissions of the owner if the execve or setuid system call is used.
  • set gid (?): all new files created will belong to the group of the directory, and on an executable file, this will cause it to run with the permissions of the group.
  • sticky bit (?): on a directory, files in the directory can only be renamed or deleted by the owner, even if other users have write permissions. This right is not very useful for files.

The Web FTP in the Manager allows you to change file permissions (including the permissions for /web).

Most FTP software/clients allow you to change file access permissions; this function is usually called "CHMOD" and can be found under "Properties," "Permissions," or "Attributes" (usually by right-clicking on the file or folder to be modified). A checkbox often allows you to apply the permissions to all subdirectories and files in the folder, in recursive mode.

Once you have checked the permissions you want, validate them, and the rights will be modified, except for those you do not have permission to modify, or rather, that the user you are logged in as does not have the right to modify.

Example with Filezilla:

 

Learn more

When we talk about changing permissions, it usually involves using a command like "chmod 777", "chmod 666", or something similar. This involves three digits:

  • the first corresponds to the owner's rights
  • the second corresponds to the group's rights
  • the third digit corresponds to the rights of other users.

And the rights are broken down as follows:

  • "4" for read access
  • "2" for write access
  • "1" for execute permission

Simply add these numbers together. For example, if you want all permissions for the owner but no permissions for others, you would use "chmod 700" (4 + 2 + 1 = 7). If you only want read and write permissions for everyone (4 + 2 = 6), you would use "chmod 666".

These values are recognized by any standard FTP software/client, so you can directly enter the number in your FTP software/client to change the permissions.

To change permissions on files or directories in PHP, you can also use the “chmod” function, as in the following example:

chmod ("/a_folder/a_file", 0755)

Note that the value to be applied must be in octal format, hence the mandatory leading zero. Be careful if you store the value in a variable, as this will cause a data type issue, which you can work around using the octdec() function, as in the following example:

$mode = 0755; chmod("a_folder/a_file", octdec($mode))

Has this FAQ been helpful?