Level Goal
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.
Commands you may need to solve this level
git
이전 레벨과 마찬가지로 git 저장소를 clone하여 패스워드를 찾으면 된다.
이번에도 git 저장소를 clone한 후 진행한다.
cat README.md
clone하면 나타나는 repo
디렉토리 내에 README.md
파일의 내용을 살펴보니 아래와 같았다.
This time your task is to push a file to the remote repository.
Details:
File name: key.txt
Content: 'May I come in?'
Branch: master
key.txt
라는 파일에 May I come in?
문자열을 저장하고 원격 저장소에 push하라는 내용이 있었다. git에 push할 때는 일단 변경 및 추가된 파일들을 staging area에 add하고, commit한 후 push한다.
echo "May I come in?" > key.txt
git add -f .
git commit -m "key add"
git push origin master
master branch에 push하라고 했으므로 위와 같은 명령어를 순차적으로 입력하여 원격 저장소에 key.txt
파일을 추가한 commit을 push한다. 원격 저장소에 성공적으로 push할 수는 없었지만(push 못하게 막아놓음) 다음 레벨로 가는 패스워드는 얻을 수 있다.