Linux file permissions are the foundation of system security. Every file and directory has an owner, a group, and a set of permissions that control who can read, write, or execute it.
Each file has three permission classes:
And three permission types:
| Permission | Symbol | Numeric |
|---|---|---|
| Read | r | 4 |
| Write | w | 2 |
| Execute | x | 1 |
Change permissions with chmod using numeric or symbolic mode:
# Numeric mode — 755 = rwxr-xr-x
chmod 755 script.sh
# Symbolic mode
chmod u+x script.sh # add execute for owner
chmod go-w script.sh # remove write for group and othersChange ownership with chown:
chown user:group file.txt
chown -R user:group /path/to/dir # recursiveThe umask command sets default permissions for new files:
umask 022 # files get 644, directories get 755Understanding permissions is essential for securing your Linux system and troubleshooting access issues.
Related Articles
Linux File Permissions Guide
A practical guide to understanding and managing Linux file permissions using chmod, chown, and umask.
tcpdump — Network Packet Analysis for Sysadmins
Use tcpdump to capture and analyze network traffic like a senior network engineer. Debug DNS, TCP handshakes, and slow connections.
lsof and ss — Open Files and Sockets Deep Dive
Master lsof and ss to find what files are open, which processes hold sockets, and why you cannot unmount a filesystem.