I once locked myself out of my files with a simple mistyped command. This was the first time I rendered my Linux installation unusable, and it was because I didn’t understand permissions. While I stared at my terminal, I felt like a guest in my own system. That moment taught me that on Linux, control is earned, not given, and I needed to pay the DIY price of using Linux.
Once you master how Linux handles files—who can read, write, or execute—you become a true Linux admin. I’ve mastered several Linux permission commands, and they’re the top terminal commands I’d recommend to you.
chmod
Control who can read, write, or execute files
After I learned why a certain script refused to run, I started u…
I once locked myself out of my files with a simple mistyped command. This was the first time I rendered my Linux installation unusable, and it was because I didn’t understand permissions. While I stared at my terminal, I felt like a guest in my own system. That moment taught me that on Linux, control is earned, not given, and I needed to pay the DIY price of using Linux.
Once you master how Linux handles files—who can read, write, or execute—you become a true Linux admin. I’ve mastered several Linux permission commands, and they’re the top terminal commands I’d recommend to you.
chmod
Control who can read, write, or execute files
After I learned why a certain script refused to run, I started using the “chmod” command more often. All Linux files have a permission level: read (r), write (w), and execute (x). If you run the command chmod +x followed by the name of the script, the system will execute the file like a program.
chmod also allows you to change permissions numerically. chmod 755 filename gives the owner full access (rwx) and everyone else read and execute (r-x). After you hit your first “Permission denied” message, this command may become muscle memory.
I use the command **chmod -R 755 folder **when I set up scripts in a project directory. But be careful with the -R flag, because it applies the permission change recursively to every file and directory in the tree. Also, applying 755 recursively can unintentionally set execute bits on regular files.
chown
Take ownership of files like an admin
“chown” is the command that rescues me when I copy files between drives and can’t access them afterward. It directly affects access by changing ownership of a file or folder. The basic format is: sudo chown user:group filename.
You’ll need it after moving system-critical data or restoring a backup. For instance, when I need my web server (Apache) to read a folder, I use the command sudo chown -R www-data:www-data /path/to/project, where **www-data **is the dedicated username and group for the Apache web server.
My advice is to use it carefully, especially if you’re including the recursive flag. Changing ownership to another user or root can prevent the original user from editing files without sudo.
umask
Set default permissions for new files
On Linux, the umask defines how new files and directories inherit access rights. Linux uses your current umask value to determine which permissions to mask (remove) from the base permission. The umask command lets you view or change this setting for your current session.
The common umask default is 0022, and it removes write access from “group” and “other” users. You can type umask to view your current value, and a command like** umask 0027** will change it for the current session. This setting makes new files safer, typically blocking access to other users or anyone outside your group.
You may consider setting a custom umask in your configuration file (like .bashrc) to create a persistent privacy baseline. Using this simple tweak will improve security in shared environments by automatically applying secure defaults across all your new scripts and logs.
sudoers
Grant or restrict admin privileges safely
People may argue that you only become a true Linux admin after successfully editing the sudoers file. Your /etc/sudoers file determines who has sudo rights and which commands they can run. As a rule, I always edit it with sudo visudo to prevent syntax errors that may lock me out.
On Linux Mint, if I need to give another user admin rights, I use the sudo usermod -aG sudo username command. This is much cleaner and safer than manually editing a file, even though you may need specific command permissions for advanced setups.
Note that some distros use different group names other than sudo (like “wheel” on Fedora).
Linux has a robust security model, so be cautious when editing the sudoers file. A wrong entry may remove your root access, but when used correctly, you can automate your admin tasks cleanly.
groups
See which access circles you belong to
Groups on Linux define what you can access and tell you where you belong in the hierarchy. For instance, if I run the command groups afam, it may return afam sudo adm lp, showing I’m a user with admin privileges and have access to printers.
Running the command sudo usermod -aG project afam can make all the difference if I join a new project. It allows me to run scripts and edit files alongside teammates without needing sudo for each command.
I use the groups command a lot while configuring Docker or virtual machines to grant my user the necessary permissions to run the daemon or access hardware devices. Understanding this command allows smoother workflows and fewer roadblocks caused by permissions.
id
Identify yourself to the system
The id command shows you who you are to the system, which is needed before you fix permissions. Simply running the id command will show your user ID (UID), group ID (GID), and list all the groups you belong to. While it doesn’t directly label your user type, your UID can infer which of the four main Linux user types you fall under.
I rely on the command when I need to debug access issues. So if a certain shared folder isn’t opening, I may use id to see if my user matches the owner or the group, confirming whether a “permission denied” issue is about identity or permissions.
I pair “id” with “-u” and “-g” flags to get a better picture of file ownership. The “-u” flag shows my numeric user ID, and “-g” shows my group ID. Even though id isn’t a glamorous command, knowing your identity is often half the fix when I hit a roadblock.
From user to admin: where control truly begins
I’ve seen a few people ditch Linux for Windows, and a lack of understanding of Linux permissions may contribute to the friction that pushed them away. All the commands I’ve shared show how the system sees you and the controls you have. These are important on Linux because you’ll run into “Permission denied” errors more often than you think.
You can now stop feeling intimidated by Linux and thrive in an ecosystem that puts near-absolute control back in your hands.