> For the complete documentation index, see [llms.txt](https://fademaze.gitbook.io/fademaze-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fademaze.gitbook.io/fademaze-docs/linux/permissions.md). Agents can also search and read this documentation through its [MCP server](https://fademaze.gitbook.io/fademaze-docs/~gitbook/mcp).

# Permissions

In this page, I'll show you how to set permissions for files.

### Modes

<pre><code>sudo <a data-footnote-ref href="#user-content-fn-1">chmod</a> <a data-footnote-ref href="#user-content-fn-2">7</a><a data-footnote-ref href="#user-content-fn-3">7</a><a data-footnote-ref href="#user-content-fn-4">0</a> <a data-footnote-ref href="#user-content-fn-5">-R</a> <a data-footnote-ref href="#user-content-fn-6">Documents/</a>
</code></pre>

**How do I know know which digit I need?**

Add the digits with each other, depending on which permissions you want to grant:

* 4 - **read**
* 2 - **write**
* 1 - **execute** (*often required too*)

### Ownership

`sudo` [`chown`](#user-content-fn-7)[^7] `-R` [`owner:group`](#user-content-fn-8)[^8] `.`

[^1]: *change mode*

[^2]: The first digit (**7**) represents read, write and execute to the **user owner**.

[^3]: The second digit (7) also represents read, write and execute to the **group owner**.

[^4]: The last digit (**0**) grants other users no access.

[^5]: **-R** means *recursive* - to apply on all files and in the subdirectories.

[^6]: It can also be a file.

[^7]: *change ownership*

[^8]: The owners of the file/folder
