Bandit27->28
Level Goal
There is a git repository at ssh://bandit27-git@localhost/home/bandit27-git/repo via the port 2220. The password for the user bandit27-git is the same as for the user bandit27.
Clone the repository and find the password for the next level.
Commands useful to solve the level
Helpful Reading Material
Where to start?
Here we enter a series of levels that are aimed to teach us the git basics. Let's dive right in and solve the first level
Part 1 : Getting the repository
Our first challenge in our quest to master Git is to unterstand how to get a copy of a guide repository (or clone).
Hint
By doing the first part of the gittutorial and reading the
git-clone man page, can you figure out a way to retrieve the
repository located at ssh://bandit27-git@localhost/home/bandit27-git/repo ?
Info
You might need to create a temporary directory
Solution
Lets first change directory to a temporary directory with cd "$(mktemp -d /tmp/bandit27git.XXXXX)",
then we can run the following command :
git clone ssh://bandit27-git@localhost:2220/home/bandit27-git/repo
We can then enter the password for bandit27-git (which is the password for bandit27) and we
see the repository repo appear in our temporary directory.
We can now try to retrieve the password.
Part 2 : Retrieving the password
For this level, the password retrieval is pretty straightforward.
Hint
Try listing the contents of the directory.
Solution
By running cat README.md we can retrieve the password for the next level.
Full Solution
cd "$(mktemp -d /tmp/bandit27git.XXXXXX)"to change to a temporary directorygit clone ssh://bandit27-git@localhost:2220/home/bandit27-git/repoto clone the repository into our directorycat READMEto retrieve the password
You can now jump to the next level