completely redesigned notes

This commit is contained in:
Hugh Ratsch
2025-03-02 09:26:39 -06:00
parent 9f724bc25c
commit cd36415d1d
10 changed files with 567 additions and 46 deletions
+26 -3
View File
@@ -14,9 +14,32 @@
- [Practice Scenarios v5](practice-scenarios/rhcsa_practice_scenarios_v5.md)
# My Solutions Portfolio
- [Introduction to Solutions](solutions/README.md)
- [Portfolio Overview](solutions/README.md)
## User Management [👤]
- [User Management Solutions](solutions/user-management.md)
- [Storage Solutions](solutions/storage-management.md)
- [Network Solutions](solutions/networking.md)
- [Creating Users with Specific Requirements (v1-S1)](solutions/user-management.md#scenario-creating-users-with-specific-requirements)
- [Departmental User Structure (v1-S1 Expanded)](solutions/user-management.md#scenario-creating-users-with-specific-requirements-1)
## Storage Management [💾]
- [Storage Management Solutions](solutions/storage-management.md)
- [LVM Configuration and Extension (v1-S2)](solutions/storage-management.md#scenario-create-a-new-2gb-partition-on-devsdb-and-extend-the-logical-volume-by-500mb-using-lvm)
## Service Management [⚙️]
- [Service Management Solutions](solutions/service-management.md)
- [Time Synchronization and Security (v1-S3)](solutions/service-management.md#scenario-time-synchronization-and-security-configuration)
## Networking [🌐]
- [Network Solutions](solutions/networking.md)
## Security [🔒]
- [Security Solutions](solutions/security.md)
## Container Management [📦]
- [Container Management Solutions](solutions/container-management.md)
## System Recovery & Maintenance [🔧]
- [System Recovery Solutions](solutions/system-recovery.md)
## Shell Scripting [📜]
- [Shell Scripting Solutions](solutions/shell-scripting.md)
+20 -15
View File
@@ -2,24 +2,29 @@
Welcome to my RHCSA practice solutions portfolio. This section documents my hands-on experience solving various Linux system administration scenarios. Each solution demonstrates my practical skills and approach to real-world problems.
## How to Navigate This Portfolio
## Solutions Categories
This portfolio is organized by major RHCSA exam objectives:
- User Management
- Storage Management
- Networking
- Service Management
- Security
This portfolio is organized into the following categories:
Each section contains detailed solutions that include:
1. **Scenario Description**: The original problem statement
2. **Environment Setup**: Details about the testing environment
3. **Solution Approach**: Step-by-step problem-solving methodology
4. **Commands Used**: Key commands with explanations
5. **Verification**: How I verified the solution works
6. **Key Learnings**: Important takeaways from the exercise
| Category | Icon | Description | Related Scenarios |
|----------|------|-------------|-------------------|
| **User Management** | 👤 | User creation, permissions, group management | v1-S1, v2-S1, v3-S1 |
| **Storage Management** | 💾 | Partitioning, LVM, filesystem management | v1-S2, v2-S2, v3-S2, v3-S8 |
| **Service Management** | ⚙️ | Service configuration, systemd, process control | v1-S3 (partial), v2-S3, v3-S9 |
| **Networking** | 🌐 | Interface configuration, routing, DNS | v1-S7, v2-S7, v3-S7 |
| **Security** | 🔒 | SELinux, firewalld, SSH hardening | v1-S3 (partial), v2-S5, v3-S5 |
| **Container Management** | 📦 | Podman, container configuration | v1-S4, v2-S4, v3-S4 |
| **System Recovery & Maintenance** | 🔧 | Boot management, troubleshooting | v1-S5, v2-S8, v3-S3 |
| **Shell Scripting** | 📜 | Automation, system monitoring | v1-S6, v2-S6, v3-S6 |
## Solution Template
## Scenario Reference System
Each scenario solution is tagged with a reference code that makes it easy to identify:
- **v1-S1**: Version 1, Scenario 1
- **v2-S3**: Version 2, Scenario 3
- **v3-S5**: Version 3, Scenario 5
## Solution Documentation Format
When documenting a solution, I follow this format:
+68
View File
@@ -0,0 +1,68 @@
# Container Management Solutions [📦]
This section documents my solutions to container-related scenarios, including Podman/Docker management, container networking, and persistent storage.
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S4] | Container Management - Practice Scenarios v1 |
| [v2-S4] | Container Operations - Practice Scenarios v2 |
| [v3-S4] | Advanced Container Deployment - Practice Scenarios v3 |
## Scenario: [v1-S4] Container Management
### Original Problem
From Practice Scenarios v1, Scenario 4:
1. Pull the latest nginx container image from registry.access.redhat.com
2. Create a persistent volume at /data/web
3. Run nginx container with the persistent volume mounted at /usr/share/nginx/html
4. Configure the container to start automatically on boot
5. Expose the container on port 8080
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v2-S4] Container Operations
### Original Problem
From Practice Scenarios v2, Scenario 4:
1. Pull MariaDB container from registry.redhat.io
2. Configure persistent storage for database files
3. Create a pod with both MariaDB and phpMyAdmin
4. Configure container networking for internal communication
5. Set up automatic container restart policies
6. Create a systemd service file for the pod
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S4] Advanced Container Deployment
### Original Problem
From Practice Scenarios v3, Scenario 4:
1. Create a multi-container application using podman
2. Configure container health checks
3. Set up container networking with port mapping
4. Implement container resource limits
5. Create persistent storage for containers
6. Configure logging drivers
7. Set up container monitoring
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
+59 -4
View File
@@ -1,11 +1,24 @@
# Network Solutions
# Network Solutions [🌐]
This section documents my solutions to networking scenarios, including network configuration, troubleshooting, and security.
## Scenario: Network Interface Configuration
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S7] | Network Configuration - Practice Scenarios v1 |
| [v2-S7] | Network and Storage Troubleshooting - Practice Scenarios v2 |
| [v3-S7] | Network Services Configuration - Practice Scenarios v3 |
## Scenario: [v1-S7] Network Interface Configuration
### Original Problem
[To be filled with actual scenario]
From Practice Scenarios v1, Scenario 7:
1. Configure static IPv4 address: 192.168.1.100/24
2. Configure static IPv6 address: 2001:db8:1234:5678::100/64
3. Set hostname to 'rhcsa.example.com'
4. Configure DNS resolution using /etc/resolv.conf
5. Implement network access restrictions using firewalld zones
### Environment
- OS Version: RHEL/Rocky Linux
@@ -58,4 +71,46 @@ nslookup example.com
- Network Troubleshooting
- Network Security
[Additional scenarios will be documented here as completed]
## Scenario: [v2-S7] Network and Storage Troubleshooting
### Original Problem
From Practice Scenarios v2, Scenario 7:
1. Diagnose and repair failed NFS mounts
2. Recover from a failed LVM configuration
3. Fix network connectivity issues
4. Restore correct SELinux contexts after file restoration
5. Configure autofs for user home directories
6. Set up network teaming for redundancy
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S7] Network Services Configuration
### Original Problem
From Practice Scenarios v3, Scenario 7:
1. Configure network with:
- Bonded interface with active-backup
- VLAN configuration
- Static routes
2. Set up DNS resolution with:
- Multiple DNS servers
- Search domains
- Local host entries
3. Implement network security with:
- TCP Wrappers
- IPtables rules
- Fail2ban configuration
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
+61 -3
View File
@@ -1,11 +1,22 @@
# Security Solutions
# Security Solutions [🔒]
This section documents my solutions to security-related scenarios, including SELinux, firewall configuration, and security hardening.
## Scenario: SELinux Configuration
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S3] | Service and Security Management (Security Part) - Practice Scenarios v1 |
| [v2-S5] | Security Implementation - Practice Scenarios v2 |
| [v3-S5] | Comprehensive Security Setup - Practice Scenarios v3 |
## Scenario: [v1-S3] SELinux and Firewall Configuration
### Original Problem
[To be filled with actual scenario]
From Practice Scenarios v1, Scenario 3 (Security Part):
- Configure firewall to allow HTTP (port 80) and HTTPS (port 443)
- Create an SELinux policy to allow Apache to listen on port 8080
- Configure SSH to disable root login and only allow key-based authentication
### Environment
- OS Version: RHEL/Rocky Linux
@@ -63,4 +74,51 @@ curl localhost/custom/path
- Security Auditing
- System Hardening
## Scenario: [v2-S5] Security Implementation
### Original Problem
From Practice Scenarios v2, Scenario 5:
1. Configure SELinux for a custom web application running on port 8443
2. Set up firewalld rich rules to allow access only from specific IP range
3. Implement file access controls using ACLs
4. Configure sudo access for specific commands
5. Set up password complexity requirements
6. Configure SELinux boolean settings for web services
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S5] Comprehensive Security Setup
### Original Problem
From Practice Scenarios v3, Scenario 5:
1. Implement a complete SELinux security strategy:
- Custom policy module
- Port definitions
- File contexts
- Boolean settings
2. Configure firewalld with:
- Multiple zones
- Custom services
- Forward ports
- Rich rules
3. Set up SSH with:
- Custom port
- AllowUsers configuration
- Rate limiting
- Key-based authentication only
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
[Additional scenarios will be documented here as completed]
+55 -5
View File
@@ -1,8 +1,16 @@
# Service Management Solutions
# Service Management Solutions [⚙️]
This section documents my solutions to service management scenarios, including systemd services, process management, and service configuration.
## Scenario: Web Server Configuration
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S3] | Service and Security Management - Practice Scenarios v1 |
| [v2-S3] | Process and Service Management - Practice Scenarios v2 |
| [v3-S9] | Service Management and Monitoring - Practice Scenarios v3 |
## Scenario: [v1-S3] Web Server Configuration
### Original Problem
[To be filled with actual scenario]
@@ -63,12 +71,10 @@ curl localhost
- Log Analysis
- Security Configuration
[Additional scenarios will be documented here as completed]
---
---
## Scenario: Time Synchronization and Security Configuration
## Scenario: [v1-S3] Time Synchronization and Security Configuration
### Original Problem
- Configure chronyd to sync with time server 'time.example.com'
@@ -198,3 +204,47 @@ sudo systemctl status cron
- Cron Job Management
- Firewall Configuration
- Time Synchronization
## Scenario: [v2-S3] Process and Service Management
### Original Problem
From Practice Scenarios v2, Scenario 3:
1. Configure system to start in graphical.target
2. Set up Apache web server to start at boot
3. Create a systemd service for a custom application
4. Configure process nice levels for specific applications
5. Set up logging rotation for application logs
6. Configure journald for persistent logging
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S9] Service Management and Monitoring
### Original Problem
From Practice Scenarios v3, Scenario 9:
1. Configure systemd services with:
- Dependencies
- Custom environment files
- Restart policies
2. Set up service monitoring with:
- Custom status checks
- Email notifications
- Automatic recovery
3. Implement logging with:
- Remote syslog
- Custom journald configuration
- Log forwarding
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
+73
View File
@@ -0,0 +1,73 @@
# Shell Scripting Solutions [📜]
This section documents my solutions to shell scripting scenarios, including automation, monitoring, and system management scripts.
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S6] | Shell Scripting - Practice Scenarios v1 |
| [v2-S6] | Automation Script - Practice Scenarios v2 |
| [v3-S6] | System Automation - Practice Scenarios v3 |
## Scenario: [v1-S6] Shell Scripting
### Original Problem
From Practice Scenarios v1, Scenario 6:
Create a script that:
1. Accepts a directory path as an argument
2. Finds all files larger than 100MB
3. Creates a report of these files including size and last modified date
4. Archives files older than 30 days into a tar.gz file
5. Logs all actions to /var/log/cleanup.log
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v2-S6] Automation Script
### Original Problem
From Practice Scenarios v2, Scenario 6:
Create a script that:
1. Monitors disk space usage
2. Sends alerts when filesystems exceed 80% usage
3. Automatically cleans up /tmp older than 7 days
4. Generates daily system health report
5. Uses getopts for command line options
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S6] System Automation
### Original Problem
From Practice Scenarios v3, Scenario 6:
Create scripts for:
1. System inventory script that:
- Lists all installed packages
- Shows disk usage
- Reports running services
- Checks SELinux status
2. Backup script that:
- Uses tar with incremental backups
- Implements retention policy
- Verifies backup integrity
- Logs all operations
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
+75 -6
View File
@@ -1,8 +1,17 @@
# Storage Management Solutions
# Storage Management Solutions [💾]
This section documents my solutions to storage management scenarios, including partitioning, LVM, filesystem management, and storage troubleshooting.
## Scenario: LVM Configuration and Management
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S2] | Storage Management - Practice Scenarios v1 |
| [v2-S2] | Storage Configuration - Practice Scenarios v2 |
| [v3-S2] | Dynamic Storage Management - Practice Scenarios v3 |
| [v3-S8] | Advanced File System Management - Practice Scenarios v3 |
## Scenario: [v1-S2] LVM Configuration and Management
### Original Problem
[To be filled with actual scenario]
@@ -55,12 +64,10 @@ df -h
- Filesystem Management
- Storage Troubleshooting
[Additional scenarios will be documented here as completed]
---
---
## Scenario: Create a new 2GB partition on /dev/sdb and extend the logical volume by 500MB using LVM
## Scenario: [v1-S2] Create a new 2GB partition on /dev/sdb and extend the logical volume by 500MB using LVM
### Original Problem
- Create a new 2GB partition on /dev/sdb
@@ -179,4 +186,66 @@ lsblk -f
- LVM Management
- Disk Partitioning
- Filesystem Management
- Storage Troubleshooting
- Storage Troubleshooting
## Scenario: [v2-S2] Storage Configuration
### Original Problem
From Practice Scenarios v2, Scenario 2:
1. Create three 1GB partitions on /dev/sdc using GPT
2. Set up LVM using these partitions
3. Create a volume group named 'appvg'
4. Create two logical volumes: 'applv' (2GB) and 'logslv' (1GB)
5. Format applv with ext4 and logslv with xfs
6. Configure persistent mounts using labels
7. Add a new swap partition of 2GB
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S2] Dynamic Storage Management
### Original Problem
From Practice Scenarios v3, Scenario 2:
1. Set up a 4GB partition using GPT on /dev/sdd
2. Create a VDO volume with 3:1 compression ratio
3. Create LVM structure on top of VDO
4. Configure thin provisioning for development environments
5. Create a 2GB XFS filesystem with quota support
6. Implement user and group quotas
7. Configure automated filesystem growth triggers
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S8] Advanced File System Management
### Original Problem
From Practice Scenarios v3, Scenario 8:
1. Create a stratis storage pool
2. Configure automated NFS mounts with autofs
3. Set up ACL configurations for:
- Default permissions
- User-specific access
- Group collaboration
4. Implement file system encryption
5. Configure file system compression
6. Set up file system snapshots
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
+70
View File
@@ -0,0 +1,70 @@
# System Recovery & Maintenance Solutions [🔧]
This section documents my solutions to system recovery and maintenance scenarios, including boot issues, emergency mode, and system troubleshooting.
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S5] | System Recovery and Maintenance - Practice Scenarios v1 |
| [v2-S8] | System Maintenance - Practice Scenarios v2 |
| [v3-S3] | Boot Management and Recovery - Practice Scenarios v3 |
## Scenario: [v1-S5] System Recovery and Maintenance
### Original Problem
From Practice Scenarios v1, Scenario 5:
1. Reset root password using emergency mode
2. Identify and kill a process consuming excessive CPU
3. Configure system to boot into multi-user target by default
4. Configure autofs to automatically mount an NFS share
5. Create a backup of /etc using tar with bzip2 compression
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v2-S8] System Maintenance
### Original Problem
From Practice Scenarios v2, Scenario 8:
1. Configure local repository for package management
2. Set up automated security updates
3. Configure logrotate for custom application logs
4. Create a backup strategy for system configuration
5. Schedule system maintenance tasks using cron and at
6. Configure time synchronization with multiple time sources
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S3] Boot Management and Recovery
### Original Problem
From Practice Scenarios v3, Scenario 3:
1. Configure system with multiple boot targets
2. Create a custom boot target for minimal services
3. Configure GRUB2 with password protection
4. Set up system to boot with specific kernel parameters
5. Create a recovery procedure for:
- Forgotten root password
- Failed boot
- Corrupted GRUB
6. Configure crash dump collection
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
+60 -10
View File
@@ -1,11 +1,19 @@
# User Management Solutions
# User Management Solutions [👤]
This section contains my solutions to various user management scenarios from the practice exercises.
## Scenario: Creating Users with Specific Requirements
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S1] | User and Permission Management - Practice Scenarios v1 |
| [v2-S1] | System Access and File Management - Practice Scenarios v2 |
| [v3-S1] | Advanced User Management - Practice Scenarios v3 |
## Scenario: [v1-S1] Creating Users with Specific Requirements
### Original Problem
From Practice Scenarios v3: Create a user named 'john' with a custom shell and home directory.
From Practice Scenarios v1: Create a user named 'john' with a custom shell and home directory.
### Environment
- OS Version: Rocky Linux 8.x
@@ -46,9 +54,9 @@ From Practice Scenarios v3: Create a user named 'john' with a custom shell and h
***
***
# Scenario: Creating Users with Specific Requirements
## Scenario: [v1-S1] Creating Users with Specific Requirements (Expanded)
## Original Problem
### Original Problem
- Create a new user called 'analyst1' with home directory '/home/analyst1'
- Create a group called 'datateam'
- Add 'analyst1' to 'datateam'
@@ -56,12 +64,12 @@ From Practice Scenarios v3: Create a user named 'john' with a custom shell and h
- Ensure members of 'datateam' can read/write, others can only read
- Set password expiry for 'analyst1' to 90 days
## Environment
### Environment
- OS Version: RHEL 9.5
- Initial State: No user 'analyst1' exists
- Required Outcome: User 'analyst1' created with specific requirements
## Solution Steps
### Solution Steps
1. Step 1 - Create the user 'analyst1'
```bash
sudo useradd -m -d /home/analyst1 analyst1
@@ -100,15 +108,57 @@ From Practice Scenarios v3: Create a user named 'john' with a custom shell and h
```
This sets the password expiry for 'analyst1' to 90 days
## Verification
### Verification
Commands used to verify the solution works correctly
## Key Learnings
### Key Learnings
- Understanding of useradd, groupadd, usermod, mkdir, chown, chmod, chage commands
- Importance of verifying user creation
- Importance of setting password expiry
## Additional Notes
### Additional Notes
> [NOTE]
> This scenario is a good example of how to create a user with a specific home directory, add them to a group, create a directory owned by the group with SGID set, and set password expiry.
## Scenario: [v2-S1] System Access and File Management
### Original Problem
From Practice Scenarios v2, Scenario 1:
1. Configure SSH to listen on port 2222 instead of default 22
2. Create a user 'devops1' with custom shell /bin/bash
3. Set up password-less SSH authentication for 'devops1'
4. Create directory structure /opt/projects with subdirectories dev, test, prod
5. Configure appropriate permissions where only devops1 can access prod
6. Create both soft and hard links for important config files
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]
## Scenario: [v3-S1] Advanced User Management
### Original Problem
From Practice Scenarios v3, Scenario 1:
1. Create a departmental structure with groups: 'engineering', 'qa', and 'ops'
2. Add users 'eng1', 'eng2', 'qa1', 'ops1' to respective groups
3. Configure shared directory /opt/shared with:
- Engineering can read/write their directory
- QA can read engineering, read/write QA directory
- Ops can read/write all directories
4. Implement password policies:
- Minimum 12 characters
- Maximum age 60 days
- Warning 7 days before expiry
### Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
### Solution Steps
[Your solution will be added here]