How-to

chmod 755: What It Grants and Where It Fits

Mode 755 is the default shape of a public folder or program on Linux. It is the right answer often, and the wrong one more often than people think.

What does 755 mean exactly?

Owner 7 (read, write, execute), group 5 (read, execute), others 5 (read, execute). In letters: rwxr-xr-x. The owner may change the file; everyone else may read it and run it, or, for a folder, list it and enter it. Nobody but the owner may modify it.

chmod 755 /usr/local/bin/rotate-reports
ls -l /usr/local/bin/rotate-reports
# -rwxr-xr-x 1 root root 1840 Dec  3 09:12 /usr/local/bin/rotate-reports

Where is 755 the right mode?

  • Programs and scripts everyone may run, typically in /usr/local/bin, owned by root.
  • Public folders that services must walk through, such as /srv, /var/www and a site's document root.
  • Home directory parents like /home itself, so each user can reach their own folder.
  • Chroot jail folders for SFTP, which sshd requires to be root-owned and not writable by others; see SFTP vs SSH.

In each case, the owner is the only one who should change things, and others need to pass through or run the file.

Where is 755 the wrong mode?

On anything that is data rather than a program. A configuration file, an image or a PHP script read by PHP-FPM does not need the execute bit. Giving it one is harmless most of the time, but it signals carelessness and can matter when a misconfigured web server tries to execute files from an upload folder. Data files want 644, or 640 if they hold anything private.

Private material should not be 755 either. Home directories on a multi-user machine are better at 750 or 700, and folders holding secrets, keys or customer exports at 700. Both big Debian-family systems now lean private by default: Ubuntu creates new homes with mode 750, and Debian 12 and 13 use 700.

How does 755 compare with nearby modes?

ModeOwnerGroupOthersPick it when
755rwxr-xr-xAnyone may read or run, only owner changes
750rwxr-xnoneOnly a service group needs access
775rwxrwxr-xA team shares write access through a group
711rwx--x--xOthers may enter by exact path but not list
644rw-r--r--Plain readable files, no execute needed

On a single-purpose machine where only you and one service account exist, the difference between 755 and 750 is small. On a box shared by several customers or developers, choose 750 and put the service user in the right group.

How do I apply 755 to folders and 644 to files in one tree?

Do not run chmod -R 755 on a whole site; that marks every image and config file executable. Treat the two types separately:

find /var/www/shop -type d -exec chmod 755 {} +
find /var/www/shop -type f -exec chmod 644 {} +

Or in one pass with a symbolic mode where capital X adds execute only to folders and files that already had it:

chmod -R u=rwX,go=rX /var/www/shop

More patterns for whole trees are in chmod recursively.

Does 755 let a web server write uploads?

Only if the web server is the owner. With 755, the group and others cannot write. The clean way to allow uploads is to make the upload folder owned by the service account, for example chown www-data: /var/www/shop/uploads on Debian and Ubuntu or nginx/apache on Enterprise Linux, and keep 755 on it. The rest of the code stays owned by your deploy user, so a compromised PHP process cannot rewrite the application. On Rocky Linux and AlmaLinux, also label the folder for writes with semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/shop/uploads(/.*)?' and restorecon -R.

How do I check modes in a tree quickly?

find /var/www/shop -type f -perm /111 -not -path '*/bin/*' | head
find /var/www/shop -perm -o+w -ls

The first lists files carrying any execute bit outside a bin folder. The second finds anything writable by others, which should return nothing on a healthy server.

Keep Reading

The chmod command

Change file modes with numbers or letters, understand what each bit does and use special bits like setgid and sticky correctly.

Open

chmod recursively

Change permissions across whole folder trees without breaking them: chmod -R, the capital X trick and find for files versus folders.

Open

Linux file permissions

Read ls -l output, understand owner, group and other bits, umask defaults, ACLs and why root and SELinux sit on top of it all.

Open

Web hosting with a control panel

Host client sites under a free hosting panel; one IPv4 serves every HTTPS site through SNI and NVMe keeps PHP pages fast.

Open

FAQ

Quick Answers

It gives the owner full access and lets everyone else read and execute the file or enter the folder.

Folders yes, usually. Files should be 644, since they do not need the execute bit.

775 also lets the group write. Use it for shared team folders, 755 when only the owner should change things.

On shared machines 750 or 700 is better, so other users cannot read your files.

Use find with -type d and -exec chmod 755, or chmod -R with u=rwX,go=rX.