> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.xynta.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Explaining File Permissions

All files and directories on a server have specific permissions. These permissions determine who can view or modify the data.  
You can adjust these permissions via **FTP**, **SSH**, or through the **hosting control panel** under **File Manager**.

All our hosting packages run inside isolated containers. Changing file permissions **does not affect** the access rights of other customers.

* [File permissions explained](#3-file-permissions-explained)
* [Choosing file permissions](#3-choosing-file-permissions)
* [Setting file permissions](#3-setting-file-permissions)
* [Need assistance?](#3-need-assistance)
---

### 📚 File permissions explained

Our servers use the Linux/Unix filesystem, where permissions are indicated by a **three-digit code**:

| Code | Meaning | Representation |
| ---- |
| 0 | No permissions | `---` |
| 1 | Execute only | `--x` |
| 2 | Write only | `-w-` |
| 3 | Write + execute | `-wx` |
| 4 | Read only | `r--` |
| 5 | Read + execute | `r-x` |
| 6 | Read + write | `rw-` |
| 7 | Full permissions | `rwx` |

|| ℹ️ **Note**: Execute permission does not apply to PHP scripts — they can run as long as the webserver has access. File permissions are still critical for Perl scripts.
---

### 🛠️ Choosing file permissions

In the File Manager, you can see the **user (UID)** and **group (GID)** ownership of files and directories.

**Default permissions:**

* Files: `644`
* Directories: `755`

**Adjust when needed:**

* Write to a directory via PHP → `775`
* Write to a file via PHP → `664`

| Code | Permissions |   |
| ---- |
| 644 | Read/write for owner, read-only for group/others | (files) |
| 664 | Read/write for owner and group, read-only for others | (files) |
| 666 | Read/write for everyone | (not recommended) |
| 755 | Full access for owner, read/execute for group/others | (directories) |
| 775 | Full access for owner and group, read/execute for others | (directories) |
| 777 | Full access for everyone | (not recommended) |
---

### ⚙️ Setting file permissions

You can adjust permissions via:

* **Control panel**:
  In **DirectAdmin** (Web/Reseller Hosting) or **Plesk** (WordPress Hosting).

* **FTP client**:
  Connect using FTP and adjust permissions (e.g., in **FileZilla**).

* **SSH**:
  Use commands to modify file and directory permissions.

**Basic SSH commands:**

*File:*

```
chmod 644 filename.php
```

*Directory:*

```
chmod 755 directoryname/
```

*Directory and contents:*

```
chmod -R 755 directoryname/
```

**Set all files and directories at once:**

*Files:*

```
find . -type f -exec chmod 0664 {} \;
```

*Directories:*

```
find . -type d -exec chmod 0775 {} \;
```

||| 🔔 **Important**: Do not run these commands above the `domains/` directory to avoid disrupting system files like email and logs!
---

### 🤝 Need assistance?

Need help fixing file permissions?  
Feel free to contact us — we're happy to assist you!