Week 1 of KodeKloud’s 100 Days Challenge: Days 1-4 (Or: How I Learned to Stop Worrying and Love the Slow Labs
Source: Dev.to
Day 1 – Non‑Interactive Users
The challenge was to create a user with a non‑interactive shell.
sudo useradd -s /usr/sbin/nologin username
getent passwd username
Mistake: Ran the commands on the wrong host. Spent several minutes wondering why validation failed before realizing I was on my local terminal instead of the lab VM.
Lesson: Always double‑check which host you’re on (run hostname first).
Day 2 – Temporary Users
Create a user account with an expiration date.
sudo useradd anita -e 2023-06-05
chage -l anita
This creates a “ticking time‑bomb” account—useful for temporary contractors or interns.
Bonus trick: Auto‑lock the account after 20 minutes.
echo "usermod --lock username" | at now + 20 minutes
Mistake: Again executed on the wrong host.
Day 3 – Disabling Root SSH
Manual approach
sudo vi /etc/ssh/sshd_config
# Change: #PermitRootLogin no → PermitRootLogin no
sudo systemctl restart sshd
Doing this manually on three servers was tedious (≈30 s per SSH connection).
Automated solution
for server in app1 app2 app3; do
ssh "$server" "sudo sed -i 's/#PermitRootLogin no/PermitRootLogin no/' /etc/ssh/sshd_config && sudo systemctl restart sshd"
done
What took 30 minutes became a 2‑minute coffee break.
Lesson: If you repeat a task more than twice and it’s boring, automate it.
Day 4 – File Permissions
Make a script executable for all users.
chmod 755 /tmp/xfusioncorp.sh
ls -l /tmp/xfusioncorp.sh
Output: -rwxr-xr-x
Permission breakdown
7(rwx) – full access for owner5(r-x) – read & execute for group5(r-x) – read & execute for others
Common patterns
chmod 644 file.txt # Owner: rw, Group/Others: r
chmod 755 script.sh # Owner: rwx, Group/Others: rx
chmod 600 secret.txt # Owner: rw, Group/Others: none
Week 1 Stats
- Commands run: ~50
- Wrong‑host mistakes: 2
- Lab loading time: ~5 min per lab
- “Why isn’t this working?” moments: 7
- Times I questioned my career: 3
Key Takeaways
Commands I now know by heart
useradd -s /usr/sbin/nologin username
chage -l username
chmod 755 script.sh
Mistakes that taught me
- Always check
hostnamebefore running commands. - Automate anything you do more than twice.
- Lab speed ≠ learning speed.
What’s Next
Days 5‑8 will cover:
- Package management (
yum,apt,dnf) - Service management (
systemctldeep dive) - Cron jobs and scheduling
- More automation