LFCS: Operations & Deployment (25%)
This section covers system administration tasks related to configuring the kernel, managing processes and services, scheduling jobs, managing software, recovering systems, and working with virtualization, containers, and SELinux.
Goals
Operations Deployment25%
- Configure kernel parameters, persistent and non-persistent
- Diagnose, identify, manage, and troubleshoot processes and services
- Manage or schedule jobs for executing commands
- Search for, install, validate, and maintain software packages or repositories
- Recover from hardware, operating system, or filesystem failures
- Manage Virtual Machines (libvirt)
- Configure container engines, create and manage containers
- Create and enforce MAC using SELinux
1. Configure Kernel Parameters
Learn
- Difference between temporary (runtime) and persistent kernel parameters.
- Tools:
sysctl,/etc/sysctl.conf, and/etc/sysctl.d/*.conf.
Commands
# Show all parameters
sysctl -a
# Set a runtime parameter (non-persistent)
sudo sysctl net.ipv4.ip_forward=1
# Persist parameter across reboots
echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
# Modern persistent configuration (preferred)
echo "net.ipv4.ip_forward = 1" | sudo tee /etc/sysctl.d/99-custom.conf
sudo sysctl --system
Exercises
- Enable IP forwarding temporarily and verify:
sysctl net.ipv4.ip_forward - Make IP forwarding permanent using
/etc/sysctl.d/.
2. Manage Processes and Services
Learn
- Identify, monitor, and troubleshoot processes.
- Manage services with systemd.
Commands
# Process management
ps aux | grep <name>
top
htop # if installed
kill <PID>
kill -9 <PID>
# Systemd service management
systemctl status <service>
systemctl start <service>
systemctl stop <service>
systemctl enable <service>
systemctl disable <service>
systemctl restart <service>
systemctl reload <service>
# View logs for a service
journalctl -u <service>
# List active services
systemctl list-units --type=service
Exercises
- Find the PID of a running process and stop it gracefully.
- Enable and start a service at boot time.
- View service logs with
journalctl.
3. Manage Scheduled Jobs
Learn
- Use cron for recurring tasks (user or system-level).
- Use at for one-time scheduled jobs.
Commands
# List user cron jobs
crontab -l
# Edit user cron jobs
crontab -e
# System-wide cron directories
ls /etc/cron.daily/
ls /etc/cron.weekly/
# At job example
echo "touch /tmp/testfile" | at now + 1 minute
atq # list scheduled at jobs
atrm <job_number>
Exercises
- Schedule a script to run every day at 3 AM.
- Schedule a one-time task using
at. - Check
/etc/cron.daily/for system maintenance tasks.
4. Software Management
Learn
- Install, update, and remove software using your system’s package manager.
- Manage repositories and dependencies.
Commands
# Debian/Ubuntu
sudo apt update
sudo apt install <package>
sudo apt remove <package>
dpkg -l | grep <package>
dpkg -s <package>
# Manage repositories
sudo add-apt-repository ppa:<repo>
cat /etc/apt/sources.list.d/*.list
# RHEL/CentOS
sudo yum install <package>
sudo yum remove <package>
rpm -qa | grep <package>
rpm -qi <package>
# Repository management
yum repolist
Exercises
- Install
curland verify installation. - Remove a package and confirm removal.
- List all enabled repositories.
5. Recover from Hardware, OS, or Filesystem Failures
Learn
- Boot into rescue or recovery mode.
- Use Live CD/USB for system repair.
- Use
fsckto check and repair filesystems.
Commands
# Filesystem check (unmounted partition)
sudo fsck /dev/sdX1
# Mount for inspection or repair
sudo mount /dev/sdX1 /mnt
# Kernel/hardware diagnostics
dmesg | less
journalctl -xb
# Disk health (if smartmontools installed)
sudo smartctl -a /dev/sdX
Exercises
- Simulate a corrupted filesystem on a test partition and repair it using
fsck. - Boot into rescue mode and inspect partitions with
lsblk. - Review logs with
journalctl -xb.
6. Virtual Machines (libvirt)
Learn
- Manage VMs using libvirt tools (
virsh,virt-install). - Control VM lifecycle and connect via console.
Commands
virsh list --all
virsh start <vm>
virsh shutdown <vm>
virsh destroy <vm> # Force shutdown
virsh console <vm>
# Virtual network management
virsh net-list
virsh net-start default
Exercises
- Create a VM using
virt-install. - Start, stop, and connect to the VM via console.
- Verify virtual networks using
virsh net-list.
7. Containers (Docker / Podman)
Learn
- Create, start, stop, and manage containers and images.
- Understand container networking and volumes.
Commands
# Docker examples
docker run -it --name mycontainer ubuntu bash
docker ps
docker stop mycontainer
docker rm mycontainer
docker images
docker rmi <image>
# Volumes and networks
docker volume ls
docker network ls
# Podman equivalents (rootless alternative)
podman run -it --name mycontainer ubuntu bash
podman ps
podman images
podman rm -a
Exercises
- Create an Ubuntu container and install
curlinside it. - Commit the container as a new image:
docker commit mycontainer ubuntu-with-curl - Remove the container and image.
- List container networks and volumes.
8. SELinux (Mandatory Access Control)
Learn
- SELinux modes: enforcing, permissive, disabled.
- Troubleshoot SELinux denials and manage contexts.
Commands
# Check SELinux status
sestatus
# Change mode temporarily
sudo setenforce 0 # permissive
sudo setenforce 1 # enforcing
# Check logs for denials
ausearch -m avc
# Check and restore file contexts
ls -Z /path
restorecon -Rv /path
# Manage custom contexts
sudo semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
sudo restorecon -Rv /web
Exercises
- Switch SELinux to permissive mode and verify.
- Trigger an SELinux denial (e.g., mislabel file) and view logs with
ausearch. - Restore a file’s correct SELinux context.
🧪 Exam Tips
- Practice all commands without
sudo, as exam environments often run as root. - Understand the difference between runtime vs persistent configurations:
- Kernel parameters (
sysctl) - SELinux modes
- Service enablement
- Kernel parameters (
- Use lab VMs to safely experiment with:
- Containers and virtual machines
- Cron jobs and recovery procedures
- Review logs regularly (
journalctl,dmesg,ausearch).
✅ Summary:
This guide now comprehensively covers all Operations Deployment (25%) objectives: