Skip to main content

LFCS: Operations & Deployment (25%)

This section covers system administration tasks related to configuring the kernel, managing processes, jobs, software, hardware recovery, and containers.


1. Configure Kernel Parameters

Learn

  • Temporary (runtime) vs persistent kernel parameters.
  • Tools: sysctl and /etc/sysctl.conf.

Commands

# Show all parameters
sysctl -a

# Set a runtime parameter
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

Exercises

  1. Enable IP forwarding temporarily and check status.
  2. Make IP forwarding permanent.

2. Manage Processes and Services

Learn

  • Identify, monitor, and troubleshoot processes.
  • Systemd services management.

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>

Exercises

  1. Find the PID of a running process and stop it gracefully.
  2. Enable and start a service on boot.

3. Manage Scheduled Jobs

Learn

  • Cron jobs: user (crontab) and system (/etc/cron*).
  • At jobs for one-time scheduling.

Commands

# List user cron jobs
crontab -l

# Edit user cron jobs
crontab -e

# At job example
echo "touch /tmp/testfile" | at now + 1 minute
atq       # list scheduled at jobs
atrm <job_number>

Exercises

  1. Schedule a job to run a script every day at 3am.
  2. Schedule a one-time task using at.

4. Software Management

Learn

  • Install, update, validate packages using native package manager.
  • Repositories and dependency management.

Commands

# Debian/Ubuntu
sudo apt update
sudo apt install <package>
dpkg -l | grep <package>

# RHEL/CentOS
sudo yum install <package>
rpm -qa | grep <package>

Exercises

  1. Install curl and verify it is installed.
  2. Remove a package and confirm removal.

5. Recover from Hardware, OS, or Filesystem Failures

Learn

  • Boot into rescue/recovery mode.
  • Use Live CD/USB for repair.
  • Basic filesystem check: fsck.

Commands

sudo fsck /dev/sdX1
sudo mount /dev/sdX1 /mnt

Exercises

  1. Simulate a corrupted filesystem on a test partition and repair it.
  2. Boot into rescue mode and inspect disk partitions.

6. Virtual Machines (libvirt)

Learn

  • Install and manage VMs using libvirt and virsh.

Commands

virsh list --all
virsh start <vm>
virsh shutdown <vm>
virsh destroy <vm>   # force shutdown
virsh console <vm>

Exercises

  1. Create a VM using virt-install.
  2. Start, stop, and connect to the VM via console.

7. Containers (Docker / Podman)

Learn

  • Create, start, stop, and manage containers.
  • Understand container networking and volumes.

Commands

# Run container
docker run -it --name mycontainer ubuntu bash

# List running containers
docker ps

# Stop and remove container
docker stop mycontainer
docker rm mycontainer

# List images
docker images

Exercises

  1. Create an Ubuntu container and install curl inside it.
  2. Commit container changes to a new image.
  3. Remove the container and image.

8. SELinux (Mandatory Access Control)

Learn

  • Enforce, permissive, and disabled modes.
  • Troubleshoot SELinux denials.

Commands

# Check current mode
sestatus

# Change mode temporarily
sudo setenforce 0   # permissive
sudo setenforce 1   # enforcing

# Check SELinux logs
ausearch -m avc

Exercises

  1. Switch SELinux to permissive mode and verify.
  2. Trigger an SELinux denial (e.g., wrong file context) and check logs.

Exam Tips

  • Practice all commands without root shortcuts (sudo) to simulate exam conditions.
  • Understand runtime vs persistent changes (kernel, SELinux, services).
  • Use lab VMs to experiment with containers, VMs, and cron jobs.