---
title: "How to Set File and Directory Permissions Recursively in Linux"
description: "Reset directories to 755 and files to 644 recursively with FileZilla or find over SSH, and learn why the Plesk File Manager cannot set them separately."
url: "https://docs.noiz.ie/server-administration/how-to-set-file-and-directory-permissions-recursively-in-linux/"
section: "Server Administration"
categories:
  - "Server Administration > File Management"
last_reviewed: "27 July 2026"
---

# How to Set File and Directory Permissions Recursively in Linux

Incorrect permissions on your directories or files will often cause unexpected behaviour, and can leave your site insecure.

Web servers commonly return a **500 Internal Server Error** when the permissions on your web directories and files are set incorrectly, so getting them right is one of the first things to check when a site stops loading.

This guide explains how to recursively set the correct permissions on your directories and files, using three different methods so you can pick whichever suits your setup.

***Note:** This is also the procedure to follow if you need to reset the permissions on a WordPress site, for example after a migration or a botched plugin install.*

**Last reviewed:** 27 July 2026. This guide is written for Noiz hosting and is kept current against the Plesk and ISPConfig 3 control panels and the FileZilla FTP client. It complements, and does not replace, the official documentation linked below.

### Official Documentation Reference

- [WordPress: Changing File Permissions](https://developer.wordpress.org/advanced-administration/server/file-permissions/) (the authoritative reference for the values a WordPress site expects).
- [Plesk Obsidian Customer Guide](https://docs.plesk.com/en-US/obsidian/customer-guide/) (File Manager, under Websites & Domains).

## Which permissions should you use?

On a standard Linux web server, the safe baseline is:

- **755** for directories (the owner can read, write and enter the directory; everyone else can read and enter it, but not write to it), and
- **644** for files (the owner can read and write; everyone else can only read).

These are the values a default WordPress installation expects, and they work for almost every PHP application. The important thing is that directories and files need *different* values, so any method that sets both to the same number will break something.

**Never** set a file or directory to **777**. It grants write access to every user on the server and is the single most common cause of a hacked WordPress site. If a tutorial elsewhere tells you to use 777 to fix an upload problem, the real issue is almost always file ownership, not permissions.

**Table of contents**

- [Set permissions using FileZilla](#set-permissions-using-filezilla),
- [Set permissions using Plesk](#set-permissions-using-plesk), and
- [Set permissions using the Linux command line](#set-permissions-using-the-linux-command-line).

## Set permissions using FileZilla

If you are hosted on one of the Noiz ISPConfig 3 servers, or you have a managed server with Noiz, or you simply prefer working in a graphical FTP client, this is the method for you. [FileZilla](https://filezilla-project.org/) is a free, open-source FTP client for Windows, macOS and Linux.

Follow these steps to recursively set permissions on directories, files, or both.

1. Connect to your hosting over FTP with FileZilla. On the Noiz ISPConfig 3 servers, your website lives in the `/web` directory.
2. Navigate into the root directory of your application. In this example, you are resetting the permissions on a WordPress installation.
3. Right-click the directory you want to change and select the **File permissions** option.
4. To set the directories first, enter `755` in the **Numeric value** field, tick **Recurse into subdirectories**, and choose **Apply to directories only**. Click **OK**.

<!-- IMG: filezilla-directory-permissions | alt: The FileZilla file permissions dialog with the numeric value set to 755, 'Recurse into subdirectories' ticked, and 'Apply to directories only' selected -->

FileZilla will now walk through every directory and sub-directory, setting each one to 755.

5. Repeat the process to set the files. Right-click the same top-level directory, choose **File permissions** again, enter `644` in the **Numeric value** field, tick **Recurse into subdirectories**, and this time choose **Apply to files only**. Click **OK**.

<!-- IMG: filezilla-file-permissions | alt: The FileZilla file permissions dialog with the numeric value set to 644, 'Recurse into subdirectories' ticked, and 'Apply to files only' selected -->

Because FileZilla lets you apply the change to directories or files separately, you can set both correct values in two passes without breaking anything. That is what makes it a better choice than a panel-based file manager for this task.

## Set permissions using Plesk

Plesk includes a full-featured file manager that can set directory permissions from within the control panel, without any FTP client.

Follow these steps to reset the permissions on your web space. The example below uses a domain called `yourdomain.com` (replace this with your own domain) running a WordPress installation.

1. Log in to the Plesk control panel for the subscription that holds your web application.
2. Open the **Websites & Domains** section from the left-hand navigation bar.
3. Choose your subscription from the dashboard to open the management page for that domain.

![The Websites & Domains section of the Plesk control panel showing a subscription dashboard](/images/kb/73_plesk-websites-and-domains.png)

4. Click **File Manager**, found in the **Files & Databases** group on the dashboard. This opens the file manager at the root directory for the web space.

![The Plesk File Manager open at the web space root directory](/images/kb/71_plesk-file-manager.png)

5. To the left of the directory you want to change, open the row menu and choose **Change Permissions**.

![The Plesk File Manager row menu with the Change Permissions option highlighted](/images/kb/70_plesk-change-permissions-menu.png)

6. Set the permissions to **755**. Graphically, that means:
    - **Read** is ticked for Owner, Group and Others,
    - **Write** is ticked for Owner only, and
    - **Execute/Search** is ticked for Owner, Group and Others.
7. Tick **Change permissions of enclosed files and subdirectories** (labelled **Change permissions recursively** in some Plesk versions) so the whole tree is updated.
8. Click the blue **OK** (or **Save**) button at the bottom to apply the change.

![The Plesk Change Permissions dialog with 755 selected and 'Change permissions of enclosed files and subdirectories' ticked](/images/kb/72_plesk-permissions-dialog.png)

**Important gotcha:** Plesk does *not* let you set files separately from directories. If you recurse a directory with 755, every file inside it is also set to 755, which is the wrong value for files and will leave them world-executable. For that reason, if you are resetting a real application such as WordPress, use the FileZilla method above or the command-line method below instead, both of which handle directories and files separately.

## Set permissions using the Linux command line

The command line is the fastest and most precise method, and the only one that resets directories and files in one go while keeping them correct. If you have SSH access, or you are on a managed or cloud server, this is the recommended approach.

Connect to your server over SSH and identify your web root. On the Noiz ISPConfig 3 servers this is the `/web` directory inside your site's home folder; on a Plesk subscription it is the `httpdocs` directory.

Set every directory (and sub-directory) to 755:

```
find /path/to/webroot -type d -exec chmod 755 {} \;
```

Set every file to 644:

```
find /path/to/webroot -type f -exec chmod 644 {} \;
```

Replace `/path/to/webroot` with the real path to your site. The `find` command walks the entire tree; the `-type d` and `-type f` tests are what let you target directories and files separately, which is exactly what a panel file manager cannot do.

### WordPress: protect wp-config.php

Once a WordPress site is back to 755/644, tighten the one file that holds your database credentials. Restricting `wp-config.php` to **640** (or **600**) stops other users on a shared server from reading your database password:

```
chmod 640 /path/to/webroot/wp-config.php
```

The official [WordPress documentation](https://developer.wordpress.org/advanced-administration/server/file-permissions/) confirms these values for a suexec setup, which is how Noiz shared hosting runs.

## Troubleshooting

**Symptom:** The site still shows a 500 error after resetting permissions. Check that no directory or the site root has been left at 777, and that a security file such as `.htaccess` is set to 644, not 640 or 600, so the web server can read it.

**Symptom:** Permissions look correct but the site still will not load, or you see permission-denied errors in the logs. The problem is usually file *ownership* (the user and group that own the files), not permissions. This commonly happens after a migration or after editing files as `root`. Ownership cannot be fixed from FileZilla or the Plesk file manager, so on a managed Noiz plan the quickest fix is to raise a support ticket and Noiz will correct it for you.

If you are on a managed or shared plan and would rather not touch permissions yourself, [contact Noiz support](https://www.noiz.co.za/submitticket.php) and the correct permissions and ownership will be set for you.

---
Source: https://docs.noiz.ie/server-administration/how-to-set-file-and-directory-permissions-recursively-in-linux/
