Skip to content

Bandit 18 → 19

OverTheWire Linux Progressive

Goal: read the readme even though .bashrc closes any interactive login immediately.

Pass the command as the final argument to ssh, so it runs without ever opening an interactive shell.

bandit18@bandit
$ ssh bandit18@bandit.labs.overthewire.org -p 2220 cat readme
The password you are looking for is: <password>
PasswordcGWpMaKXVwDUNgPAVJbWYuGHVn9zl3j8

An interactive login sources .bashrc or .profile upon connecting. This one contains immediate exit directive, so a normal session dies before you can type. Supplying a command as the last ssh argument runs it through a non-interactive shell that skips the interactive startup scripts and returns the output directly.