Chapter 8 Learning System Administration
8.1 Understanding System Administration
su command — Opens a shell as the root user.
sudo command — Allows normal users to run commands with root privileges.
8.2 Using Graphical Management Tools
Cockpit is a browser-based system administration tool.
- Install Cockpit
| |
- Log in as root and enable the Cockpit socket
| |
- Open the interface in your browser:
localhost:9090
8.2.1 Using system-config-* Tools
| Tool | Command | Description |
|---|---|---|
| DNS | system-config-bind | Create and configure zones if the computer acts as a DNS server |
| HTTP | system-config-httpd | Apache Web Server |
| NFS | system-config-nfs | Set up shared directories with other computers using NFS |
| Root Password | system-config-rootpassword | Change the root password |
| Samba NFS | system-config-samba | Configure Windows shared folders |
| Services | system-config-services | View and change services at different runlevels in Fedora |
| Authentication | authconfig-gtk | Change how the system authenticates users |
| Date & Time | system-config-date | Set date and time or sync with an NTP server |
| Firewall | system-config-firewall | Configure the firewall |
| Language | system-config-language | Select the system language |
| Printing | system-config-printer | Configure local and network printers |
| SELinux Management | policycoreutils-gui | Set SELinux enforcement mode and default policies |
| Users & Groups | system-config-users | Manage user accounts |
8.3 Using the root User Account
8.3.1 Becoming root via Shell
Use the su command to switch to the root user, but the environment variables will remain those of the original account.
Use su - to switch the environment variables to root’s as well.
Additionally, use su - username to switch to a specific user.
8.3.2 Using sudo for Administrative Access
Commands run with sudo have root privileges. You don’t need the root password; you just need to grant the user the appropriate permissions.
Granting sudo permissions:
Run the
visudocommand as root.Add a line like the following:
| |
This grants the user yexca sudo privileges.
- Save the changes.
8.4.2 Managing Configuration Files
Most configuration files are plain text located in the /etc directory. Here are some examples:
| Directory | Description |
|---|---|
| /etc/cron* | Defines programs scheduled by crond, such as cron.daily and cron.hourly. |
| /etc/cups | Configuration files for the CUPS printing service. |
| /etc/default | Files that set default values for various utilities. |
| /etc/httpd | Configures Apache Web Server behavior. |
| /etc/rc?.d | Separate rc?.d directories for each system state: rc0.d (shutdown), rc1.d (single-user), rc2.d (multi-user), rc3.d (multi-user + networking), rc4.d (user-defined), rc5.d (multi-user + networking + GUI login), and rc6.d (reboot). |
| /etc/skel | Files in this directory are copied to a new user’s home directory when the account is created. |
| /etc/sysconfig | Contains important system configuration files created and maintained by various services. |
| /etc/systemd | Contains files associated with the systemd utility (used to manage boot processes and system services). |
| /etc/xinetd.d | Contains files defining on-demand network services that the xinetd daemon listens for on specific ports. |
8.4.3 Managing Log Files and Systemd.Journal
Uses rsyslogd and the systemd journalctl command.
rsyslogd (and its predecessor syslogd) places files in the /var/log directory.
8.5 Using Other Administrative Accounts
Accounts like lp, apache, and bin are not allowed to log in by default.
If you need to log in, you must change the default shell from /sbin/nologin or /bin/false to a real shell like /bin/bash.
8.6 Checking and Configuring Hardware
8.6.1 Checking Hardware
Use dmesg or journalctl to view hardware detection and driver loading info from Linux boot.
Use lspci to see the PCI bus and connected devices, lsusb for USB device info, and lscpu for processor details.
8.6.2 Using Loadable Modules
If you need to add hardware that isn’t recognized correctly, you might need to load a module manually.
- List loadable modules
Use the lsmod command. To get details on a specific module, use modinfo -d module_name.
- Load a module
Use modprobe to load any module compiled and installed for the running kernel.
- Remove a module
Use rmmod, or modprobe -r to remove the module along with its dependencies.
8.7 Summary
In Linux, you should create separate users for various services (http, git, etc.) and restrict their login permissions to ensure system security.
Chapter 9 Installing Linux
None
Graphical installation is straightforward. For other installation methods, refer to the Arch Wiki Installation Guide .
I also wrote a (lesser) post: Arch Linux Installation Record in VM – yexca’s Blog
Remote installation methods like PXE boot are not covered here as they are difficult to replicate for this guide.