Linux Learning Chapters 8 & 9: System Administration and Installing Linux

📢 This article was translated by gemini-3-flash-preview

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.

  1. Install Cockpit
1
sudo dnf install cockpit
  1. Log in as root and enable the Cockpit socket
1
sudo systemctl enable --now cockpit.socket
  1. Open the interface in your browser: localhost:9090

8.2.1 Using system-config-* Tools

ToolCommandDescription
DNSsystem-config-bindCreate and configure zones if the computer acts as a DNS server
HTTPsystem-config-httpdApache Web Server
NFSsystem-config-nfsSet up shared directories with other computers using NFS
Root Passwordsystem-config-rootpasswordChange the root password
Samba NFSsystem-config-sambaConfigure Windows shared folders
Servicessystem-config-servicesView and change services at different runlevels in Fedora
Authenticationauthconfig-gtkChange how the system authenticates users
Date & Timesystem-config-dateSet date and time or sync with an NTP server
Firewallsystem-config-firewallConfigure the firewall
Languagesystem-config-languageSelect the system language
Printingsystem-config-printerConfigure local and network printers
SELinux Managementpolicycoreutils-guiSet SELinux enforcement mode and default policies
Users & Groupssystem-config-usersManage 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:

  1. Run the visudo command as root.

  2. Add a line like the following:

1
2
3
4
5
yexca    ALL=(ALL)    ALL

# Or the following to allow sudo without a password
# (This refers to the user's password, not the root password)
yexca    ALL=(ALL)    NOPASSWD:ALL

This grants the user yexca sudo privileges.

  1. Save the changes.

8.4.2 Managing Configuration Files

Most configuration files are plain text located in the /etc directory. Here are some examples:

DirectoryDescription
/etc/cron*Defines programs scheduled by crond, such as cron.daily and cron.hourly.
/etc/cupsConfiguration files for the CUPS printing service.
/etc/defaultFiles that set default values for various utilities.
/etc/httpdConfigures Apache Web Server behavior.
/etc/rc?.dSeparate 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/skelFiles in this directory are copied to a new user’s home directory when the account is created.
/etc/sysconfigContains important system configuration files created and maintained by various services.
/etc/systemdContains files associated with the systemd utility (used to manage boot processes and system services).
/etc/xinetd.dContains 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.

  1. List loadable modules

Use the lsmod command. To get details on a specific module, use modinfo -d module_name.

  1. Load a module

Use modprobe to load any module compiled and installed for the running kernel.

  1. 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.