DevOps & Linux Administration
Users, Permissions & Packages
Module IV: Users, Permissions & Packages. This module introduces Linux user management, file permissions, administrative privileges, and software package management. These concepts are extremely important in Linux administration, server management, and DevOps workflows.
Linux as a Multi-User Operating System
Linux is designed as a multi-user operating system, meaning multiple users can access and use the same system simultaneously while maintaining security and separation between accounts.
Each user has:
- Unique username and password
- Personal home directory
- Separate permissions and access rights
- Individual files and configurations
Linux User Hierarchy
Root User and sudo
The root user is the administrator account in Linux. It has complete control over the system including software installation, user management, and configuration changes.
To safely execute administrative tasks, Linux provides the sudo command which temporarily grants administrator privileges.
Example Commands
$ sudo apt update $ sudo apt install nginx $ sudo reboot
Root User
Has unrestricted system access and administrative control.
sudo Command
Allows normal users to execute administrative commands securely.
Linux File Permissions
Linux uses a permission system to control access to files and directories. Permissions determine who can read, write, or execute files.
| Symbol | Permission | Meaning |
|---|---|---|
| r | Read | View file contents |
| w | Write | Modify file contents |
| x | Execute | Run executable files |
Permission Structure
-rwxr-xr-- Owner Group Others
- First set → Owner permissions
- Second set → Group permissions
- Third set → Other users permissions
chmod Command
The chmod command is used to change file permissions in Linux.
Example Commands
$ chmod +x script.sh $ chmod 755 file.txt $ chmod 644 notes.txt
| Number | Permission |
|---|---|
| 7 | Read + Write + Execute |
| 6 | Read + Write |
| 5 | Read + Execute |
| 4 | Read Only |
Linux Package Management
Linux distributions use package managers to install, update, and remove software applications efficiently.
Package Management Workflow
| Package Manager | Distribution |
|---|---|
| apt | Ubuntu / Debian |
| yum | CentOS / Red Hat |
| pacman | Arch Linux |
Example Commands
$ sudo apt update $ sudo apt install git $ sudo apt remove nginx
Basic User Management Commands
| Command | Purpose |
|---|---|
| whoami | Displays current user |
| adduser | Creates new user |
| passwd | Changes user password |
| su | Switches user account |
Summary
In this chapter, we explored Linux users, permissions, administrative privileges, package management, and important system administration commands. These concepts are essential for Linux system management, server administration, and DevOps operations.