Linux Permissions & Users
Understanding Linux permissions is crucial for security and system administration. Think of permissions like the keys and locks in an office building: every room (file) has a lock, every person (user) carries certain keys, and the building manager (root) has the master key. Getting this wrong means either locking yourself out or leaving the vault wide open.User Management
Every process in Linux runs as a specific user. This determines what files it can read, write, and execute. There is no such thing as an “anonymous” action in Linux — everything traces back to a user.Users and Groups
Groups let you manage permissions for multiple users at once. Instead of granting file access to ten developers individually, you add them all to adev group and grant access to the group.
File Permissions
Every file and directory in Linux has three sets of permissions for three audiences: the owner, the group, and everyone else.The Permission Model
Each permission has a numeric value. You add them up to set permissions:Changing Ownership
Special Permissions
Beyond the basic rwx, Linux has three special permission bits that come up in interviews and production troubleshooting. Think of these as special-purpose locks with unusual properties — they solve problems that regular permissions cannot.Sudo and Root Access
Theroot user (UID 0) can do anything on the system — bypass all permission checks, kill any process, read any file. This power is dangerous. sudo lets you run individual commands as root without staying logged in as root.
Sudoers Configuration
Common Permission Scenarios
Scenario 1: Shared Project Directory
Scenario 2: Securing SSH Keys
Scenario 3: Web Server Files
Key Takeaways
- Every file has an owner, a group, and permissions for owner/group/others
- Use
chmodfor permissions,chownfor ownership - Numeric mode (755, 644) sets all permissions at once; symbolic mode (u+x) modifies specific bits
sudogrants temporary root access for individual commands — prefer it over logging in as root- Special bits (SUID, SGID, sticky) solve real problems but require careful use
- Always use
usermod -aG(with the-aflag) to add users to groups
Next: Linux Process Management →