~ Level 31→32 ~
Level Description
There is a git repository at ssh://bandit31-git@localhost/home/bandit31-git/repo. The password for the user bandit31-git is the same as for the user bandit31.
Clone the repository and find the password for the next level.
git is the only commmand that will be used to solve this level.
Research Before Solving
Research will be done while solving the level.
Solution Walkthrough
We will start by logging into the OverTheWire server using bandit31. We will now have to make a directory for us to work in using mkdir /tmp/user. Next, we will navigate into the created directory and clone the given git repository.

Use cd to move into the cloned repository and issue an ls to list any files. We find a file named README.md again. Use cat to see what's inside.

The file tells us that we must push a file to the remote repository. Reading further gives us the details of what the file name should be, what the contents need to be, and where to send it.
We will start this process by creating a new file named key.txt and editing it using the command vim key.txt. Hit i to insert and type in the required text. Your file should appear as follows:

After typing in the required sentence, hit esc and type :wq to save the changes and quit out of the editor.
We now need to use git add -f key.txt to prepare the file for a commit. The -f is required to force it. No confirmation output will be displayed if successful.
We can now commit the new file using git commit key.txt. After pressing enter you will be prompted to enter a message. This message will provide details of the commit in the form of a comment. These are the comments shown when using git log. Type in initial commit of key.txt, hit ctrl o followed by enter to write the changes, lastly use ctrl x to exit the nano editor.

After exiting the nano editor, we can now push the repository changes to the master branch. To do this we will use git push origin master. Type yes to confirm the connection and input the required password.

The password is provided within the output! Password: 56a9bf19c63d650ce78e6ec0354ee45e.
Delete the /tmp/user directory before moving forward.