What are permissions?
Every file and folder on Linux has three types of access: "read (r)," "write (w)," and "execute (x)." Each of those three can be set separately for three groups: the "owner," the "group," and "everyone else."
A diary file might be "owner can read and write; no one else can do anything." A website's public folder might be "owner can change it; everyone else can only read it." This granular control is one reason Linux is the preferred OS for servers. Many users can share the same machine safely.
Reading permissions
Running ls -l shows a 10-character string at the start of each entry, like -rwxr-xr--. The first character is the file type (- = regular file, d = directory). The remaining 9 characters are read in groups of three: owner, group, and others. r = read, w = write, x = execute.
You can also express permissions as numbers: r=4, w=2, x=1 — add them up. rwx=7, r-x=5, r--=4. In practice, people commonly talk about "755" or "644."
Changing permissions with chmod and chown
The command to change permissions is chmod (change mode). chmod 755 script.sh sets script.sh so "the owner can read/write/execute; everyone else can read and execute." The command to change the owner is chown, but that requires admin (sudo) privileges.
When publishing HTML files on a web server, the standard pairing is "755" for directories and "644" for files. Memorise those two and you can fix half of all "403 Forbidden" errors on your own website.
Instead of memorising numbers alone, think "who am I allowing to do what?" Don't give write access to others on files only you should edit. Don't add execute permissions to HTML or image files that don't need to run. Keep permissions on server files to the minimum necessary. That way of thinking is the foundation.
Where is this used?
Recommended practice for middle and high school students
When you see a "Permission denied" error trying to run your own script, type chmod +x filename to add execute permission — and remember that trick. It makes Python scripts, Bash scripts, and custom commands runnable. Tools downloaded from GitHub also often arrive without execute permission, so this one step fixes it.
When practicing, create a dedicated folder and test on empty text files. Check the current permissions with ls -l, change them with chmod, then check again with ls -l. Never use sudo chmod on important folders or system files without understanding what you're doing.
Pitfalls to watch out for
chmod 777means "anyone can freely modify" — the most dangerous setting. Never use it on a server.- SSH key files (id_rsa) won't work unless they're set to 600. Setting 644 will be rejected as "permissions too open."
- Setting overly permissive permissions on a web server's public folder lets attackers overwrite your files.
How will this help you in the future?
Permission settings are the absolute basics of server security — knowledge you'll use every single day in web development, infrastructure management, and cloud engineering. The concept of "permissions" is shared by cloud permission management systems like AWS IAM and Google Cloud IAM, so the understanding you build here will carry over to a wide range of future situations.
Once you understand permissions, you'll understand why admin privileges are needed, why you can't delete other people's files in a shared folder, and why write permissions are locked down on public servers. This is foundational digital literacy, not just for Linux but for using any shared computer system safely.
Things you can do today
- Run
ls -lin a terminal and look at the permission string at the start of each line. - Create a file with
touch test.sh, change permissions withchmod 755 test.sh, and confirm the result withls -l. - Write out the meaning of 644, 755, 600, and 700 on paper and memorise them.