📌 Project Overview
This repository contains solutions for Linux administration tasks from KodeKloud Engineer, organized by difficulty levels (Level 1 to Level 4). Each task is documented in a detailed Markdown file with step-by-step instructions, essential commands, verification steps, and troubleshooting tips. These solutions are designed to assist the Nautilus DevOps team in managing server infrastructure, user access, and system security efficiently across the Stratos Datacenter. Starting from basic user management to advanced system hardening and server configuration, this repository serves as a comprehensive record of my journey through the KodeKloud Engineer challenge. Note: While the core objectives and challenges remain consistent, the specific values (e.g., server names, IP addresses, or usernames) may differ based on your specific lab environment. However, the underlying concepts and technical approaches are broadly applicable to real-world Linux environments.
🔍 Purpose: Provide clear, executable solutions for Linux troubleshooting and configuration tasks, ensuring best practices in system administration.
🛠️ Tools Used:
- SSH: Secure access to app, db, and storage servers.
- Package Managers:
yum,apt,pip3for software installation. - System Utilities:
cron,firewalld,setfacl,systemd,tar,scp. - Environment: Stratos Datacenter lab environment with Jump Host access.
📂 Repository Structure:
kodekloud-engineer-linux-solutions/
├── LEVEL01/
│ ├── task-01-create-custom-apache-user-mark-stapp02.md
│ ├── task-02-create-group-add-user-nautilus-developers.md
│ ├── task-03-create-non-interactive-user-yousuf-stapp01.md
│ ├── task-04-create-service-user-ravi-no-home-stapp02.md
│ ├── task-05-create-temporary-user-john-expiry-stapp02.md
│ ├── task-06-copy-user-files-preserve-structure-stapp03.md
│ ├── task-07-disable-ssh-root-login-all-servers.md
│ ├── task-08-create-compressed-archive-storage-server.md
│ ├── task-09-grant-executable-permissions-script-stapp02.md
│ ├── task-10-configure-file-acls-permissions-stapp03.md
│ ├── task-11-replace-string-xml-file-backup-server.md
│ ├── task-12-copy-encrypted-file-scp-jump-to-stapp02.md
│ ├── task-13-configure-crontab-access-control-stapp02.md
│ ├── task-14-set-default-runlevel-graphical-all-servers.md
│ ├── task-15-synchronize-timezone-america-jamaica-all-servers.md
│ ├── task-16-configure-firewall-allow-port-8086-backup-server.md
│ ├── task-17-set-process-limits-nfsuser-storage-server.md
│ ├── task-18-install-selinux-packages-disable-stapp01.md
├── LEVEL02/
│ ├── task-01-install-cronie-configure-cron-job-all-servers.md
│ ├── task-02-update-motd-banner-all-servers.md
│ ├── task-03-setup-collaborative-directory-dbadmin-stapp03.md
│ ├── task-04-text-manipulation-grep-sed-stapp03.md
│ ├── task-05-setup-passwordless-ssh-jump-to-all-servers.md
│ ├── task-06-find-copy-php-files-preserve-structure-stapp02.md
│ ├── task-07-install-samba-package-all-servers.md
│ ├── task-08-install-ansible-4.9.0-jump-host-pip3.md
│ ├── task-09-configure-local-yum-repository-backup-server.md
│ ├── task-10-install-squid-all-app-servers.md
│ ├── task-11-allow-passwordless-sudo-rose-all-app-servers.md
│ ├── task-12-configure-dns-nameservers-stapp02.md
│ ├── task-13-configure-firewalld-all-app-servers.md
│ ├── task-14-setup-postfix-dovecot-mail-server-stmail01.md
│ ├── task-15-troubleshoot-postfix-service-stmail01.md
│ ├── task-16-install-configure-haproxy-stlb01.md
│ ├── task-17-troubleshoot-haproxy-service-stlb01.md
│ ├── task-18-troubleshoot-mariadb-service-stdb01.md
│ ├── task-19-create-website-backup-script-stapp01.md
│ ├── task-20-hardening-apache-response-headers-stapp01.md
│ ├── task-21-troubleshoot-apache-all-servers.md
│ ├── task-22-gpg-data-encryption-decryption-ststor01.md
│ ├── task-23-configure-logrotate-httpd-all-servers.md
│ ├── task-24-configure-iptables-backup-server.md
├── LEVEL03/
│ ├── task-01-configure-apache-url-redirects-stapp03.md
│ ├── task-02-configure-sftp-server-stapp02.md
│ ├── task-03-install-configure-tomcat-server-stapp03.md
│ ├── task-04-troubleshoot-apache-service-stapp01.md
│ ├── task-05-restrict-apache-port-iptables-all-servers.md
│ ├── task-06-setup-nginx-reverse-proxy-apache-stbkp01.md
│ ├── task-07-configure-apache-basic-auth-stapp03.md
│ ├── task-08-troubleshoot-apache-service-unavailability-stapp01.md
│ ├── task-09-configure-apache-pam-auth-stapp03.md
│ ├── task-10-setup-nginx-ssl-stapp02.md
├── LEVEL04/
│ ├── task-01-configure-nginx-load-balancer-stlb01.md
│ ├── task-02-troubleshoot-lemp-stack-configuration-all-app-servers.md
│ ├── task-03-setup-postgresql-database-stdb01.md
│ ├── task-04-automate-mariadb-operations-bash-script-stdb01.md
│ ├── task-05-deploy-wordpress-lamp-stack-all-servers.md
│ ├── task-06-install-configure-mariadb-stdb01.md
│ ├── task-07-host-two-static-websites-alias-stapp03.md
│ ├── task-08-configure-nginx-php-fpm-stapp03.md
│ ├── task-09-configure-nginx-php-fpm-stapp01.md
└── README.md
| Task # | Title/Link | Status | Difficulty | Description |
|---|---|---|---|---|
| 1 | Create Apache User Mark | ✅ Done | 🟢 Basic | Create a non-login user for Apache service on stapp02 |
| 2 | Create Group & Add User | ✅ Done | 🟢 Basic | Setup nautilus_developers group and add specific users |
| 3 | Create Non-Interactive User | ✅ Done | 🟢 Basic | Create a user without shell access for security on stapp01 |
| 4 | Create Service User | ✅ Done | 🟢 Basic | Create a user without a home directory on stapp02 |
| 5 | Create Temporary User | ✅ Done | 🟢 Basic | Create a user with a specific account expiration date |
| 6 | Copy User Files | ✅ Done | 🟢 Basic | Copy files while preserving directory structure on stapp03 |
| 7 | Disable SSH Root Login | ✅ Done | 🟡 Intermediate | Harden SSH security by disabling root login on all servers |
| 8 | Create Compressed Archive | ✅ Done | 🟢 Basic | Create a .tar.gz archive of data on the storage server |
| 9 | Grant Executable Permissions | ✅ Done | 🟢 Basic | Grant execute permissions to a shell script on stapp02 |
| 10 | Configure File ACLs | ✅ Done | 🟡 Intermediate | Set specific user/group permissions using ACLs on stapp03 |
| 11 | Replace String in XML | ✅ Done | 🟢 Basic | Use sed to replace strings in configuration files on backup server |
| 12 | Copy Encrypted File | ✅ Done | 🟢 Basic | Use SCP to transfer files from Jump Host to App Server 2 |
| 13 | Configure Crontab Access | ✅ Done | 🟡 Intermediate | Manage cron.allow and cron.deny for user access control |
| 14 | Set Default Runlevel | ✅ Done | 🟢 Basic | Change systemd default target to graphical on all servers |
| 15 | Synchronize Timezone | ✅ Done | 🟢 Basic | Set the correct system timezone across all infrastructure |
| 16 | Configure Firewall Rule | ✅ Done | 🟡 Intermediate | Allow specific traffic through iptables/firewalld on backup server |
| 17 | Set Process Limits | ✅ Done | 🟡 Intermediate | Configure security limits (ulimit) for users on storage server |
| 18 | Install & Disable SELinux | ✅ Done | 🟡 Intermediate | Manage SELinux packages and operational states on stapp01 |
| Task # | Title/Link | Status | Difficulty | Description |
|---|---|---|---|---|
| 1 | Install Cronie & Cron Job | ✅ Done | 🟡 Intermediate | Install cronie and schedule recurring system tasks |
| 2 | Update MOTD Banner | ✅ Done | 🟢 Basic | Update the message of the day banner on all app servers |
| 3 | Setup Collaborative Directory | ✅ Done | 🟡 Intermediate | Configure group-shared directories with SGID bit on stapp03 |
| 4 | Text Manipulation (Grep/Sed) | ✅ Done | 🟡 Intermediate | Advanced log filtering and text processing on stapp03 |
| 5 | Setup Passwordless SSH | ✅ Done | 🟡 Intermediate | Configure SSH key-based authentication from Jump Host |
| 6 | Find & Copy PHP Files | ✅ Done | 🟡 Intermediate | Find specific file types and migrate them to new directories |
| 7 | Install Samba Package | ✅ Done | 🟡 Intermediate | Deploy Samba for file sharing across the Nautilus network |
| 8 | Install Ansible (Pip3) | ✅ Done | 🟡 Intermediate | Install specific Ansible version using python-pip on Jump Host |
| 9 | Configure Local Yum Repo | ✅ Done | 🟡 Intermediate | Setup local package repository for offline updates on backup server |
| 10 | Install Squid Proxy | ✅ Done | 🟡 Intermediate | Deploy Squid proxy server for managed internet access |
| 11 | Allow Passwordless Sudo | ✅ Done | 🟡 Intermediate | Grant sudo privileges without password prompts to specific users |
| 12 | Configure DNS Nameservers | ✅ Done | 🟢 Basic | Update resolver configuration for proper name resolution |
| 13 | Configure Firewalld | ✅ Done | 🟡 Intermediate | Setup persistent firewalld rules for application traffic |
| 14 | Setup Postfix & Dovecot | ✅ Done | 🟡 Intermediate | Deploy Postfix and Dovecot mail servers on stmail01 |
| 15 | Troubleshoot Postfix | ✅ Done | 🟡 Intermediate | Resolve issues with Postfix mail service on stmail01 |
| 16 | Install & Configure HAProxy | ✅ Done | 🟡 Intermediate | Deploy and configure HAProxy load balancer on stlb01 |
| 17 | Troubleshoot HAProxy | ✅ Done | 🟡 Intermediate | Resolve issues with HAProxy service on stlb01 |
| 18 | Troubleshoot MariaDB | ✅ Done | 🟡 Intermediate | Resolve issues with MariaDB database service on stdb01 |
| 19 | Create Website Backup Script | ✅ Done | 🟡 Intermediate | Create a shell script for automated website backups on stapp01 |
| 20 | Hardening Apache Headers | ✅ Done | 🟡 Intermediate | Secure Apache by modifying response headers on stapp01 |
| 21 | Troubleshoot Apache | ✅ Done | 🟡 Intermediate | Resolve Apache service issues across all app servers |
| 22 | GPG Data Encryption | ✅ Done | 🟡 Intermediate | Encrypt and decrypt data using GPG on storage server |
| 23 | Configure Logrotate | ✅ Done | 🟡 Intermediate | Configure log rotation for Apache HTTPD on all servers |
| 24 | Configure Iptables | ✅ Done | 🟡 Intermediate | Setup persistent iptables rules on the backup server |
| Task # | Title/Link | Status | Difficulty | Description |
|---|---|---|---|---|
| 1 | Apache URL Redirects | ✅ Done | 🟡 Intermediate | Configure URL redirection in Apache on stapp03 |
| 2 | Configure SFTP Server | ✅ Done | 🟡 Intermediate | Setup secure file transfer server on stapp02 |
| 3 | Install & Configure Tomcat | ✅ Done | 🟡 Intermediate | Deploy Apache Tomcat server on stapp03 |
| 4 | Troubleshoot Apache Service | ✅ Done | 🟠 Advanced | Identify and resolve Apache service errors on stapp01 |
| 5 | Restrict Apache Port | ✅ Done | 🟡 Intermediate | Use iptables to restrict access to specific ports |
| 6 | Nginx Reverse Proxy | ✅ Done | 🟠 Advanced | Setup Nginx as a reverse proxy for Apache on stbkp01 |
| 7 | Apache Basic Auth | ✅ Done | 🟡 Intermediate | Implement basic HTTP authentication for Apache |
| 8 | Troubleshoot Apache Unavailability | ✅ Done | 🟠 Advanced | Troubleshoot why Apache service is not responding |
| 9 | Apache PAM Auth | ✅ Done | 🟠 Advanced | Configure Apache to use PAM for user authentication |
| 10 | Setup Nginx SSL | ✅ Done | 🟠 Advanced | Configure SSL/TLS for Nginx web server on stapp02 |
| Task # | Title/Link | Status | Difficulty | Description |
|---|---|---|---|---|
| 1 | Configure Nginx Load Balancer | ✅ Done | 🔴 Critical | Install and configure Nginx as a round-robin load balancer on stlb01 |
| 2 | Troubleshoot LEMP Stack | ✅ Done | 🔴 Critical | Fix Nginx and PHP-FPM misconfigurations across all app servers |
| 3 | Setup PostgreSQL Database | ✅ Done | 🟠 Advanced | Create PostgreSQL user, database, and grant full privileges |
| 4 | Automate MariaDB Operations | ✅ Done | � Critical | Write a Bash script to automate MariaDB backup and operations |
| 5 | Deploy WordPress LAMP Stack | ✅ Done | 🔴 Critical | Full LAMP stack deployment with WordPress CMS across app servers |
| 6 | Install & Configure MariaDB | ✅ Done | 🟠 Advanced | Install MariaDB and configure users, databases, and access rules |
| 7 | Host Two Static Websites (Alias) | ✅ Done | � Advanced | Configure Apache virtual hosts with aliases for two sites on stapp03 |
| 8 | Configure Nginx & PHP-FPM (stapp03) | ✅ Done | 🔴 Critical | Setup Nginx with PHP-FPM and FastCGI integration on stapp03 |
| 9 | Configure Nginx & PHP-FPM (stapp01) | ✅ Done | 🔴 Critical | Setup Nginx with PHP-FPM and FastCGI integration on stapp01 |
-
Clone the Repository:
git clone https://github.com/MiqdadProjects/KodeKloud-engineer-linux-solutions.git cd KodeKloud-engineer-linux-solutions -
Navigate to Task Files:
- Level 1 tasks:
LEVEL01/ - Level 2 tasks:
LEVEL02/ - Level 3 tasks:
LEVEL03/ - Level 4 tasks:
LEVEL04/
- Level 1 tasks:
-
Explore Solutions:
- Read the Markdown files to understand the requirements and the solution.
- Each file contains the commands used during the challenge to complete the task.
-
Troubleshooting:
- Refer to the verification sections in each task to validate your own environment.
- Use standard Linux debugging tools like
journalctl,systemctl status, andtail -f.
-
Test in Lab Environment:
- Use the provided context to replicate these setups in your own virtualized environments or KodeKloud labs.
- Linux Knowledge: Basic understanding of the Linux command line (Bash).
- Environment: Access to a Linux terminal (CentOS/Ubuntu preferred as per labs).
- Text Editor: Familiarity with
vi,vim, ornanofor file editing. - Root/Sudo Access: Required for most configuration and installation tasks.
-
Access the Servers:
ssh [username]@[server-name] # Example: ssh steve@stapp02 -
Follow Task Instructions:
- Locate the relevant
.mdfile in theLEVELfolders. - Execute commands sequentially as documented.
- Locate the relevant
-
Verify Configuration:
# Verify user creation id [username] # Verify service status systemctl status [service-name] # Verify permissions getfacl [file-path]
-
Common Troubleshooting:
- Ensure you have the correct permissions (use
sudo). - Double-check firewall rules if services are unreachable.
- Verify package availability in your configured repositories.
- Ensure you have the correct permissions (use
- Task Files: Structured as
task-XX-description.mdfor consistent navigation and search. - Environment Specifics: Always replace placeholder values like server names or IP addresses with your actual lab credentials.
- Permanence: Use the
-Por--permanentflag withfirewall-cmdto ensure rules survive reboots. - Level Completion: All 4 levels are fully documented.
Contributions are welcome! If you find an error or want to improve a solution:
- Fork the repository.
- Create a new branch:
git checkout -b fix-task-XX. - Update the relevant Markdown file.
- Commit your changes:
git commit -m "Improve Task XX documentation". - Push and open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions regarding these solutions or the KodeKloud Engineer challenge, please reach out via the repository's issue tracker.
Happy Linuxing! 🚀