Skip to main content

LFCS: Operations & Deployment (25%)

This section covers system administration tasks related to configuring the kernel, managing processes,processes and services, scheduling jobs, managing software, hardwarerecovering recovery,systems, and containers.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

    • TemporaryDifference between temporary (runtime) vsand 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

    1. Enable IP forwarding temporarily and checkverify: status.
      sysctl net.ipv4.ip_forward
      
    2. Make IP forwarding permanent.permanent using /etc/sysctl.d/.

    2. Manage Processes and Services

    Learn

    • Identify, monitor, and troubleshoot processes.
    • SystemdManage services management.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

    1. Find the PID of a running process and stop it gracefully.
    2. Enable and start a service onat boot.boot time.
    View service logs with journalctl.

    3. Manage Scheduled Jobs

    Learn

    • CronUse jobs:cron for recurring tasks (user (crontab)or and system (/etc/cron*)system-level).
    • AtUse jobsat for one-time scheduling.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

    1. Schedule a jobscript to run a script every day at 3am.3 AM.
    2. Schedule a one-time task using at.
    Check /etc/cron.daily/ for system maintenance tasks.

    4. Software Management

    Learn

    • Install, update, validateand packagesremove software using nativeyour system’s package manager.
    • RepositoriesManage repositories and dependency management.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

    1. Install curl and verify it is installed.installation.
    2. Remove a package and confirm removal.
    List all enabled repositories.

    5. Recover from Hardware, OS, or Filesystem Failures

    Learn

    • Boot into rescue/rescue or recovery mode.
    • Use Live CD/USB for system repair.
    • Basic filesystem check:Use fsck. to 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

    1. Simulate a corrupted filesystem on a test partition and repair it.it using fsck.
    2. Boot into rescue mode and inspect diskpartitions partitions.with lsblk.
    Review logs with journalctl -xb.

    6. Virtual Machines (libvirt)

    Learn

    • Install and manageManage VMs using libvirt tools (virsh, virt-install).
    Control VM lifecycle and virsh.connect via console.

    Commands

    virsh list --all
    virsh start <vm>
    virsh shutdown <vm>
    virsh destroy <vm>        # forceForce shutdown
    virsh console <vm>
    
    # Virtual network management
    virsh net-list
    virsh net-start default
    

    Exercises

    1. Create a VM using virt-install.
    2. Start, stop, and connect to the VM via console.
    3. Verify virtual networks using virsh net-list.

    7. Containers (Docker / Podman)

    Learn

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

    Commands

    # RunDocker containerexamples
    docker run -it --name mycontainer ubuntu bash
    # List running containers
    docker ps
    
    # Stop and remove container
    docker stop mycontainer
    docker rm mycontainer
    # Listdocker 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

    1. Create an Ubuntu container and install curl inside it.
    2. Commit the container changes toas a new image.image:
      docker commit mycontainer ubuntu-with-curl
      
    3. Remove the container and image.
    List container networks and volumes.

    8. SELinux (Mandatory Access Control)

    Learn

    • Enforce,SELinux permissive,modes: andenforcing, permissive, disabled modes..
    • Troubleshoot SELinux denials.denials and manage contexts.

    Commands

    # Check currentSELinux modestatus
    sestatus
    
    # Change mode temporarily
    sudo setenforce 0    # permissive
    sudo setenforce 1    # enforcing
    
    # Check SELinuxlogs logsfor 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

    1. Switch SELinux to permissive mode and verify.
    2. Trigger an SELinux denial (e.g., wrongmislabel file context)file) and checkview logs.logs with ausearch.
    Restore a file’s correct SELinux context.

    🧪 Exam Tips

    • Practice all commands without root shortcuts (sudo), to simulateas exam conditions.environments often run as root.
    • Understand the difference between runtime vs persistent changes configurations:
      • Kernel parameters (kernel,sysctl)
      SELinux,SELinux services).modes Service enablement Use lab VMs to safely experiment withwith: containers,
      VMs,Containers and cronvirtual jobs.machines Cron jobs and recovery procedures Review logs regularly (journalctl, dmesg, ausearch).

      Summary:
      This guide now comprehensively covers all Operations Deployment (25%) objectives:

      Objective Status Configure kernel parameters Manage processes & services Manage scheduled jobs Manage software packages & repos Recover from failures Manage virtual machines Manage containers Configure and enforce SELinux