chmod 755 gives the owner read, write and execute permission (7 = 4 + 2 + 1) and gives the group and everyone else read and execute (5 = 4 + 1). In ls -l it shows as rwxr-xr-x. Use 755 for directories and scripts, 644 (rw-r--r--) for normal files, and change the owner with chown, for example sudo chown alex:www-data file.
Before you start
- Connect with SSH. You can change permissions on your own files; for other files you need
sudo(root can leave it out). - Take a backup or snapshot before you change permissions recursively on a large folder.
How to read Linux permissions
Runls -l:
Each letter has a number. Add them up for each of the three positions:
What do chmod 755, 644, 600 and 777 mean?
How to change permissions with chmod
1
Set permissions with numbers
2
Or change one part with letters
u = owner, g = group, o = others, a = all. + adds, - removes, = sets exactly.3
Check the result
How to set different permissions for files and directories
chmod -R 755 makes every file executable, which you rarely want. Use find to treat them separately, for example for a website:
How to change the owner with chown
www-data on Ubuntu and Debian, and nginx or apache on AlmaLinux and Rocky Linux, depending on which web server you installed.
Special permissions: setgid and sticky bit
What is umask?
umask sets the default permissions for new files. The usual value 0022 makes new files 644 and new directories 755. Check yours with umask.
How to check it worked
Test as the user who needs access, for example the web server user:Permission denied means the user is missing r on the file or x on one of the parent directories. namei -l /var/www/example.com/index.html shows the permissions of every directory in the path.
Frequently asked questions
What is the difference between chmod 755 and 644?
755 adds execute (x). Directories need x so you can open them, and scripts need it to run. Plain files such as HTML, images and config files donāt, so they use 644.
What permissions should ~/.ssh have?
~/.ssh must be 700 and ~/.ssh/authorized_keys 600, owned by the user. SSH refuses keys when they are more open. See fix SSH āPermission denied (publickey)ā.
What does chmod +x do?
It adds execute permission for the owner, group and others (limited by your umask), so you can run the file with./script.sh.
Why does chmod say āOperation not permittedā?
Only the owner or root can change a fileās permissions. Usesudo, or check the owner with ls -l.
Related guides
VPS and dedicated server guides
Every server guide in one place.
Manage users and groups
Put users in shared groups.
Essential Linux commands
The commands you use every day.
Find files and text
Search with find and grep.
Checked against the official GNU Coreutils manual: chmod, chown and file modes on 4 November 2026; commands tested on Ubuntu 24.04 LTS. Commands can differ on other distributions or releases.
Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026