Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to change file permissions (chmod) on your server

Set chmod modes on server files in FTP by Zaweba's Disk with octal numbers or presets like 644/755, for one file or a folder and everything inside.

How to change file permissions (chmod) on your server

You change permissions in the Disk view of FTP by Zaweba. Pick the files or folders, open Permissions and either type an octal mode or click one of the presets (600/700, 640/750, or the recommended 644/755). For a folder you can choose to apply it to everything inside as well.

Chmod is the old Unix name for changing a file's mode, the numbers that say who may read, write or run it. Web hosts care about these numbers because they decide whether a visitor's browser can see a page, whether PHP can write to an uploads folder, and whether other accounts on the same server can tamper with your files.

Reading the numbers

Each digit covers one group: the owner, the group and everyone else. Read is worth 4, write 2 and run (or, for a folder, enter) 1, and the digit is the sum. So 644 means the owner can read and write, and everyone else can only read. 755 adds the right to enter or run, which folders need. Those two together are what most websites want, which is why FTP by Zaweba marks 644/755 as recommended.

600/700 is the private choice: only the owner can do anything. 640/750 sits between, letting the group read. They are useful for configuration files or folders that hold data visitors should never see.

Changing permissions step by step

Open Disk from the toolbar or the Site menu and let it scan the site. Find the files in the treemap, the list or the tree. Tagging keeps track of them while you look, and Tag by can gather files by name pattern, type, size or age if you need many at once.

Open Permissions. Type an octal mode or click a preset; files get the first number of the pair and folders the second. If folders are included, decide whether to include everything inside them. Then apply.

If what you chose would make something world-writable, FTP by Zaweba asks for an explicit I understand confirmation first. That is the setting old tutorials suggest when an upload "won't work", and it is rarely the right answer on modern hosting.

When a change goes wrong

Every change Disk makes is written to the operations log, batch by batch. Permission changes, along with renames, moves and trashing, can be undone as a batch with Undo this batch. If a script starts complaining after you tighten things, that gets you back to where you were in one step while you work out what it needs.

Finding what needs changing

You don't have to guess which files are wrong. The web-server lens in Disk lists world-writable files and folders as security problems, along with other risks such as database dumps and backup archives in public folders. Switching the list to lens results gives you a ready-made list to tag and fix.

Files Disk leaves alone

Some files would break your site or hosting account if their permissions changed: .htaccess, wp-config.php, .env, .well-known/, cgi-bin/, the web root and cPanel folders such as mail/, etc/, ssl/ and logs/. Disk treats these as protected and won't re-permission them unless you turn on a site option that allows it, which isn't recommended. A folder that merely contains a protected item can be changed, and the confirmation tells you so.

A few sensible habits

Change permissions on the smallest set of files that solves the problem. Applying a mode to everything inside public_html at once is quick, but it can undo deliberate tighter settings a developer made on configuration files.

Check the page afterwards in a browser or in Live Preview, and test anything that writes files, such as a contact form that saves attachments or a gallery upload.

If your host's documentation says a particular folder needs a specific mode, follow it. Hosts set PHP up in different ways, and what is right on one may be wrong on another. FTP by Zaweba gives you the controls and the undo; the numbers your host asks for are the ones to type.