tutorial · bandit

Bandit Level 14

Use an SSH private key to log in as the next user (instead of a password).
banditsshkeys
Optional narration
Marks this level complete in your browser.

Goal

You don’t get the next password directly.

Instead, you’re given a private SSH key that can be used to log into the next level (user bandit14).

Hints

  • The key is usually in your home directory (look for something like sshkey.private).
  • SSH uses -i <keyfile> to specify an identity file.
  • You may need chmod 600 on the key.
Solution (click to reveal)
  1. SSH into the current level:
ssh bandit14@bandit.labs.overthewire.org -p 2220
  1. List files and find the private key:
ls -la
  1. Lock down permissions (SSH is strict):
chmod 600 sshkey.private
  1. Use the key to SSH as the next user:
ssh -i sshkey.private bandit14@localhost

Once logged in as bandit14, read the password file:

cat /etc/bandit_pass/bandit14

That output is the password for Level 15.

Notes

  • Using localhost keeps you on the same box; you’re just authenticating differently.