Real-world Linux administration scenarios solved with Bash scripting, automation, and DevOps best practices.
This repository contains my solutions to a 4-part DevOps Bash scripting challenge completed during the AWS & DevOps Training at Clarusway IT School (02/2024 – 08/2024).
Each part simulates a real-world scenario that a Linux/DevOps engineer faces daily:
- 🔍 Security forensics on AWS CloudTrail logs
- 👥 User account automation for sysadmins
- 💾 Backup strategy with cronjob scheduling
- ✂️ Text processing with
sed,awk,grep,cut
linux-bash-scripting/
│
├── 01-security-cloudtrail/ → CloudTrail log analysis (Bash + grep/awk/sed)
├── 02-user-management/ → User & password automation script
├── 03-backup-cronjob/ → Compressed backup + crontab scheduling
├── 04-string-manipulation/ → Text processing tasks (3 sub-tasks)
│ ├── task1-terraform-update/ → JSON parsing → tf file update
│ ├── task2-pem-formatting/ → PEM key reformatting
│ └── task3-invalid-users/ → SSH auth log analysis
│
├── docs/ → Original project briefs (PDF)
├── screenshots/ → Execution screenshots
├── LICENSE → MIT License
└── README.md → You are here
| Skill | Where to Find It |
|---|---|
| 🐚 Bash scripting | All parts — .sh files with error handling |
| 🔎 Regex & filtering | Part 1 (CloudTrail), Part 4.3 (auth.log) |
| 🔐 User/group management | Part 2 (useradd, chage, password policies) |
| ⏰ Cronjob scheduling | Part 3 (crontab -e, every 5 min) |
| 📦 Archive compression | Part 3 (tar -czf, dynamic filenames) |
| 🧰 Text manipulation | Part 4 — sed, awk, grep, cut, uniq |
| 🔄 JSON parsing in Bash | Part 4.1 (grep -oP, regex) |
Each part is self-contained. Navigate into a folder and read its local README.md:
# Clone the repo
git clone https://github.com/maliswiss/Linux-Advance-Project.git
cd Linux-Advance-Project
# Run any script (example: backup)
cd 03-backup-cronjob
chmod +x backup.sh
./backup.shScenario: A suspicious user terminated EC2 instances. Find all instance IDs from CloudTrail logs.
Tools: grep, awk, sed, regex pattern matching
Output: result.txt with extracted instance IDs
Scenario: HR creates dozens of new Linux accounts. Automate it with one command.
Tools: useradd, chpasswd, chage, random password generation
Output: New user with auto-generated password, forced change on first login
Scenario: Backup critical folders every 5 minutes with unique compressed filenames.
Tools: tar, crontab, dynamic naming with hostname + timestamp
Output: /mnt/backup/hostname-YYYYMMDD-HHMM.tgz
- Update Terraform var from JSON — without opening either file
- Reformat single-line PEM → multi-line PEM
- Parse SSH auth.log — find invalid login attempts and their counts
The full original project specification from Clarusway is available at:
👉 docs/Linux-Advanced-Project-Brief.md
- OS: Amazon Linux 2 / Ubuntu 22.04 LTS
- Shell: Bash 5.x
- Tested on: AWS EC2 t2.micro
Mehmet Ali Gür 🎓 HF Informatik (Plattformentwicklung) @ GIBB Bern ☁️ AWS DevOps Training @ Clarusway IT School 📍 Bern, Switzerland
This project is licensed under the MIT License — see the LICENSE file for details.