Master Linux System Management: Root, Users, Groups, and Permission Controls
This article provides a comprehensive guide to Linux system management, covering the role of the root user, how to manage users and groups, methods for viewing and interpreting file permissions, and detailed usage of the chmod and chown commands to modify permissions and ownership.
Linux System Management: Deep Dive into Root User, Users & Groups, Permission Controls, and File Permission Changes
Introduction
In the previous article we explored file operation commands such as cp, mv, rm, and text‑processing tools like grep, wc and pipelines. This article continues the core concepts of Linux system management, including the role of the root user, user and group management, viewing permission information, and the use of chmod and chown commands.
1. The root user
In Linux, the root user (also called the superuser or administrator) has all permissions on the system and can perform any operation, such as installing software, modifying system files, and managing user accounts.
1.1 Switch to the root user
You can switch to the root account with the su command: su After entering the root password you obtain full root privileges.
1.2 Use sudo instead of switching
Modern distributions recommend using sudo to run commands that require root privileges, rather than logging in as root directly.
sudo apt-get update # execute a command that needs root rights1.3 The sudoers file
The configuration for sudo is stored in /etc/sudoers, which defines which users and groups may execute which commands.
2. Users and groups
Linux is a multi‑user operating system; managing users and groups is essential for system security and permission control.
2.1 User management
Add a new user: sudo adduser username Delete a user: sudo deluser username Change a user's password:
sudo passwd username2.2 Group management
Add a group: sudo groupadd groupname Delete a group: sudo groupdel groupname Add a user to a group:
sudo usermod -a -G groupname username3. Viewing permission information
Each file and directory has permission settings that control who can read, write, or execute it.
3.1 View file permissions
Use ls -l to display permissions: ls -l filename Example output:
-rwxr-xr-- 1 owner group 4096 Dec 20 12:34 filenameHere -rwxr-xr-- means the owner has read, write, and execute permissions, while the group and others have read and execute only.
3.2 Composition of file permissions
r: read permission w: write permission x: execute permission
4. chmod command: Changing file permissions
The chmod command modifies the permissions of files and directories.
4.1 Numeric mode
chmod 755 filenameIn this example, 7 (rwx) gives the owner full permissions, 5 (r-x) gives the group read and execute, and the final 5 gives others the same.
4.2 Symbolic mode
chmod u+x filenameThis adds execute permission for the file owner.
5. chown command: Changing file owner and group
The chown command changes the owner and group of files or directories.
5.1 Change file owner
sudo chown newowner filename5.2 Change file owner and group
sudo chown newowner:newgroup filenameConclusion
This article explored the core concepts of Linux system management, including the role and privileges of the root user, how to manage users and groups, how to view permission information, and the practical use of chmod and chown commands. Mastering these topics is essential for anyone seeking deep understanding of Linux administration.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
