The next challenge seems to change direction a little. We’re told that the password is located in /etc/bandit_pass/bandit14, and it’s only readable by bandit14. We are, however, provided with an ssh key that we can use to log in as bandit14. I chose to cat the contents and then add the private key to my local machine. Using the following command, we can derive the public key from the private key file: ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub. The -f switch specifies the private key file, and the -y switch outputs the public key. With this complete, we can now ssh to the bandit server as bandit14.

user@compy ~
$ ssh-keygen -y -f ./id_rsa > ~/.ssh/id_rsa.pub
user@compy ~
$ ssh -p 2220 [email protected]
 _                     _ _ _
| |__   __ _ _ __   __| (_) |_
| '_ \ / _` | '_ \ / _` | | __|
| |_) | (_| | | | | (_| | | |_
|_.__/ \__,_|_| |_|\__,_|_|\__|

a http://www.overthewire.org wargame.

Welcome to Ubuntu 14.04 LTS (GNU/Linux 4.4.0-71-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

bandit14@bandit:~$ ls
bandit14@bandit:~$