Access rights determine who can read, modify, or execute a file on the server. You can change them from the Apanel console, from your FTP software, or via the command line.
In short: in Hosting management, Tools card, open File explorer and click the padlock Permissions (chmod) next to the file. Set 644 on files and 755 on directories, never 777.
Prerequisites
- Have access to your Apanel console, to FTP software configured for your website, or to your account's SSH access.
- The file or folder must belong to you: the Apanel console only lets you change the permissions of items you own.
How do I change permissions from the Apanel console?
- Log in to your Apanel console.
- From the dashboard, click the name of your domain to open Hosting management.
- In the Tools card, click File explorer.
- Navigate to the relevant directory. The Rights column shows the current permissions of each file and folder.
- Next to the file or folder, click the padlock icon Permissions (chmod).
- In the Change file permissions (or Change folder permissions) window, tick the desired boxes for the Owner, Group, and Other: Read, Write, Execute.
- Click Save.
Which permissions to set?
| Item |
Value |
What this means |
| Website files |
644 |
You can modify them; the server can read them to serve them |
| Directories |
755 |
Same as above, plus the right to traverse the directory |
| Directory where the application writes (file uploads, cache) |
755, sometimes 775 |
Apply only to directories that actually require it |
| Configuration files (database passwords) |
600 or 640 |
Readable only by you and by the server |
Never use 777. This is advice often found in forums to "unblock" an installation that refuses to write, but it is a security risk: any script hosted on the server can then modify your files. If an application requires 777, it indicates a problem elsewhere: contact support rather than opening up permissions.
How do I change permissions by FTP or SSH?
-
From FTP software: right-click on the file, then File permissions… (FileZilla) or Permissions. Most FTP clients offer this command, sometimes called CHMOD.
-
Via SSH: the chmod command. To change the permissions of all .php files in a directory and its subdirectories, use find:
chmod 644 index.php
chmod 755 mon-dossier
find mon-dossier -name '*.php' -exec chmod 644 {} +
SSH access must first be enabled: see Connect to your hosting via SSH.
Troubleshooting
| Symptom |
Clue |
| Error 403 "Forbidden" |
Missing read permissions on the file, or missing execute permission on a directory in the path |
| Error 500 |
Permissions too broad on a script: some configurations refuse to execute a file that is writable by everyone |
| The application cannot upload files |
Missing write permission on the destination directory: add it to that directory only |
Going further