Mastering Linux Shells : A TryHackMe Walkthrough
In this post, I delve into the Linux Shells module from TryHackMe’s Cyber Security 101 learning path. This module offers a comprehensive introduction to Linux command-line interfaces, shell scripting,
Module Overview
🛠️ Key Scripts from the Module
1. The Locker Script
#!/bin/bash
# Defining the variables
username=""
companyname=""
pin=""
# Defining the loop
for i in {1..3}; do
# Defining the conditional statements
if [ "$i" -eq 1 ]; then
echo "Enter your Username:"
read username
elif [ "$i" -eq 2 ]; then
echo "Enter your Company name:"
read companyname
else
echo "Enter your PIN:"
read pin
fi
done
# Checking if the user entered the correct details
if [ "$username" = "John" ] && [ "$companyname" = "Tryhackme" ] && [ "$pin" = "7385" ]; then
echo "Authentication Successful. You can now access your locker, John."
else
echo "Authentication Denied!!"
fi
Note: Ensure you're executing it with Bash and not sh. Practical Exercises
🔗 Repository Overview
Last updated
