RHCSA (028): Season 2 - Scenario 3 of 25: Pristine State Migration

Executive Summary: RHCSA Episode 28 Lab

Note: Before I started this lab, I had to first login to my Linode Rocky Linux lab server via secure shell (ssh). On my system, I did so with the follow command (you'll have to replace rhcsa-lab-server with whatever network name or ip address that you chose for your Linode):

ssh root@rhcsa-lab-server

RHCSA Podcast Episode 28 features a RHEL-focused Rocky Linux lab titled "Pristine State Migration," designed to simulate a timed exam task that integrates four distinct RHCSA testing domains into a single workflow. The primary goal of this lab is to validate critical system administration skills including dependency management, archiving, symlink creation, and permission hardening. The exercise strictly enforces a "leave no trace" philosophy, requiring the administrator to track installed packages and restore the system to its original state post-operation, a discipline that mirrors the precision required in production environments.

This lab sharpens the candidate's proficiency across several official exam objectives by strictly validating the creation and configuration of file systems. Specifically, the scenario drills the syntax for archiving with gzip compression (Objective 1.6) and link management (Objective 1.9), while simultaneously enforcing security best practices through strict ownership assignments and octal permissions (Objective 1.10). By requiring the user to identify missing tools via rpm queries and install software packages with dnf, the lab ensures that candidates can adapt to the immediate task requirements while maintaining system integrity.

The technical execution of the lab proceeds in four distinct phases, beginning with a Pre-Flight Check to establish the environment by verifying the tar utility and generating sample user data. This is followed by the Core Task, where the administrator compresses legacy data, assigns strict service account ownership, and hardens file permissions to secure the archive. The process moves to a Verification Sequence to confirm archive integrity and symbolic link functionality before concluding with a Comprehensive Cleanup phase that removes all created users, temporary files, and dependencies to ensure a clean system reset.

Keywords: RHCSA, Red Hat Certified System Administrator, EX200, Rocky Linux 9, RHEL, system administration, practical labs, tar command, gzip compression, archiving, dependency management, symbolic links, file permissions, octal permissions, chown, chmod, user management, secure archives, pristine state migration, RHCSA Series Podcast, Linux training

EPISODE 28: Pristine State Migration
- Season: 2
- Objectives: 1.6, 1.9, 1.10; 9.1
- Lab Focus: Dependency Management, Archiving, Symlinks, Permissions
- Online: https://djere.com/rhcsa-28-season-2-scenario-1-of-25-pristine-migration.html

---

TASK ANALYSIS (THE "WHY")
- Objective 1.6: Validates ability to archive and compress data while managing system tools.
- Objective 1.10: Demonstrates securing archives to prevent unauthorized data leaks.
- Requirement Management: Teaches the "leave no trace" philosophy by tracking installed packages.

---

SOLUTION STEPS WITH EXPLANATIONS

Step 1: As 'root' (Pre-Flight Check & Setup)
- rpm -q tar || dnf install -y tar
  # Checks if 'tar' is installed. If not, installs it. Note if you had to install it for Step 4!
- useradd legacy_user && mkdir -p /home/legacy_user && touch /home/legacy_user/project_{alpha,beta,gamma}.log
  # Setup the target data.
- useradd migrator
  # Setup the service account.

Step 2: As 'root' (The Core Task)
- tar -cvzf /tmp/migration_data.tar.gz /home/legacy_user/
  # Create the compressed archive.
- chown migrator:migrator /tmp/migration_data.tar.gz
  # Assign ownership to the migrator user.
- chmod 600 /tmp/migration_data.tar.gz
  # Restrict permissions (Owner only).
- ln -s /tmp/migration_data.tar.gz /home/migrator/latest_migration
  # Create the symbolic link.

Step 3: Verification Sequence
- ls -l /home/migrator/latest_migration -> EXPECTED: Link pointing to /tmp.
- sudo -u migrator tar -tvf /home/migrator/latest_migration -> EXPECTED: Archive content list.

Step 4: Comprehensive Cleanup (Zero-Trace Policy)
- userdel -r legacy_user
- userdel -r migrator
- rm -f /tmp/migration_data.tar.gz
- dnf remove -y tar
  # ONLY run this if 'tar' was NOT present during the Step 1 check!!!

You should also read:

RHCSA Series (005): Providing User Interfaces

Mind Map RHCSA_Series_5_Providing_User_Interfaces_Mind_Map │ ├── Alphabetical_List_of_Abbreviations │ ├── CLI = Command-Line Interface │ ├── CSCI = Computer Science │ ├── CSH = C…