This content originally appeared on DEV Community and was authored by Sriram Bharath
Hey friends ,
Today I started the OverTheWire Bandit challenges โ a playground where you learn real Linux + security skills by solving tiny puzzles.
It felt like a game where each level teaches you one new โhacker move.โ Hereโs my journey from Level 0 to Level 4, explained like Iโd tell a friend.
Level 0 โ Meeting SSH for the First Time
At first, I had no idea what SSH was. After running man ssh
, I learned:
SSH (Secure Shell) lets you control another computer securely from far away.
To connect to Bandit, I used:
ssh -p 2220 bandit0@bandit.labs.overthewire.org
# password: bandit0
This dropped me into another computer like stepping into a remote terminal. Boom , Level 0 cleared.
Level 1 โ The Dreaded โDashโ File
I logged into bandit1 and ran:
ls
It showed a file, but its name started with a dash (-). Thatโs tricky, because most commands treat anything starting with -
as an option.
For example, cat -n
means โcat with line numbers.โ So if you just type cat -
, the command thinks itโs a flag, not a filename.
Solution: explicitly tell Linux โthis is a file in the current directoryโ:
cat ./-
That way, ./
points to this directory and avoids confusion.
Password revealed
.
Level 2 โ Spaces in Filenames (oof)
This one made me suffer. The file literally had spaces in its name:
--spaces in this filename--
Spaces confuse the shell, because it thinks each word is a separate argument. I tried a bunch of tricks, but what worked was:
cat -- "--spaces in this filename--"
Hereโs why it works:
-
--
tells the command: stop parsing options, everything after this is just a filename. - Quoting the name
"..."
ensures spaces are treated as part of one filename, not multiple.
Lesson learned: avoid spaces in filenames if you can. Use -
or _
instead.
Level 3 โ Hidden, But Not Really
At first glance, the folder looked empty:
ls
But I knew better. Linux hides files starting with a dot (.
). To see them, you need:
ls -a
And boom, I spotted a sneaky file:
...Hiding-From-You
I opened it with:
cat "...Hiding-From-You"
and there was the password .
Quick tip:
-
ls
โ shows only normal files. -
ls -a
โ shows all files, including hidden ones.
Level 4 โ Too Many Files, Which One?
Inside inhere/
, I found multiple files. Instead of opening each one, I asked Linux:
file -- ./*
This command checks every file and tells you what type it is (text, binary, etc.).
Breakdown:
-
file
โ tells the type of a file. -
--
โ again, stop treating things as options. -
./*
โ means โall files in the current folder.โ
One of them was marked as plain text. I cat
โd it and got the password .
Quick Recap (Levels 0โ4)
-
SSH โ secure remote access (
ssh -p 2220 user@host
). - Files starting with
-
โ use./-
or--
. - Filenames with spaces โ wrap in quotes, use
--
. -
Hidden files โ
ls -a
(or-A
). - Too many files? โ
file -- ./*
finds the right one.
Wrapping Up
These first few levels taught me something super important: itโs not about memorising commands, itโs about learning how the shell thinks.
Every tricky filename, every hidden file, every โwhy wonโt this work?!โ moment is preparing me to think like both a hacker and a problem solver.
This is just the beginning โ and I can already see how much fun this journey will be.
Canโt wait to dive into the next levels and share what I learn!
โStay curious, keep exploring, and remember: with great power comes great responsibility.โ
![]()
โ Sriram Bharath (Gh0stSh3ll)
This content originally appeared on DEV Community and was authored by Sriram Bharath