Skip to content
Servers and Linux2 min read

What are file permissions (chmod)?

Short answer

File permissions on Linux define what the owner, the group and everyone else can do with a file: read (r), write (w) and execute (x). You change them with chmod; the usual values for websites are 644 for files and 755 for folders.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. How the numbers work
  2. Sensible values for websites
  3. Command examples
  4. Common mistakes
  5. On ArabyHost

Every file and folder on Linux has an owner (user), a group, and three sets of permissions: for the owner, for the group and for everyone else. Each set is written as three letters like rwx, or as a single digit that adds them up, which is why permissions usually appear as three digits.

How the numbers work

Letter Meaning Value
r Read 4
w Write 2
x Execute, or enter a folder 1

Add the values for each set: 7 = 4+2+1 (rwx), 5 = 4+1 (r-x), 4 = read only. So 755 means the owner can read, write and execute, while the group and others can only read and execute. The chmod calculator works out any value for you.

Sensible values for websites

Item Value Why
Regular files (.php, .html, images) 644 Owner edits, others read
Folders 755 x is needed to enter a folder
Sensitive config such as wp-config.php and .env 600 or 640 Keeps passwords unreadable

Command examples

ls -l index.php        # -rw-r--r-- means 644
chmod 644 index.php
chmod 600 .env
find public_html -type d -exec chmod 755 {} \;
find public_html -type f -exec chmod 644 {} \;

Common mistakes

  • Using 777: any user or process can write to the file, a common route for planting malware. Where PHP runs as the account owner you never need it, and some servers refuse to run such a file and return a 500 error.
  • A folder without x: you get 403 Forbidden because the server can’t enter it.
  • The wrong owner: if another user owns the file, chmod won’t help and you’ll see Permission denied.
  • Laravel folders: storage and bootstrap/cache must be writable by the owner, or you get a Laravel 500 error.

On ArabyHost

Every ArabyHost account runs inside CloudLinux CageFS, so other users can’t see your files, but correct permissions still matter to protect your site from vulnerable plugins and scripts. On every hosting plan you can change permissions in the cPanel File Manager (the Permissions button); on the Developer plans you can also run chmod directly over SSH. If a permissions error doesn’t make sense, the Araby AI assistant in the panel reads the error log and explains the fix.

FAQ

Should I use 777 to fix an upload or write error?

No. 777 lets any process write to the file and opens the door to compromise. Find the real cause; 755 for the folder and 644 for the file are almost always enough.

What's the difference between chmod and chown?

chmod changes the permissions (who can read, write, execute); chown changes who owns the file. On shared hosting you already own your files, and giving them to another user requires root.

What permission should wp-config.php have?

600 or 640 is the usual advice, because the file holds your database password and nobody but the account owner needs to read it.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.