해당 리포지토리를 clone하면 된다.
주어진 경로대로 clone을 시도했지만 퍼미션 디나이가 떴다.
bandit27@bandit:~$ git clone ssh://bandit27-git@localhost/home/bandit27-git/repo
fatal: could not create work tree dir 'repo': Permission denied
bandit27@bandit:~$ git clone ssh://bandit27-git@localhost:2220/home/bandit27-git/repo
fatal: could not create work tree dir 'repo': Permission denied
그러므로 tmp에 디렉터리를 생성해서 진행한다. 홈 디렉터리는 bandit은 홈 디렉터리에 쓰기 권한이 없어서 그런 듯하다.
bandit27@bandit:~$ mktemp -d
/tmp/tmp.iBw6J8BHf4
bandit27@bandit:~$ cd /tmp/tmp.iBw6J8BHf4
bandit27@bandit:/tmp/tmp.iBw6J8BHf4/repo$ ls -ald /tmp/tmp.iBw6J8BHf4
drwx------ 3 bandit27 bandit27 4096 May 23 03:03 /tmp/tmp.iBw6J8BHf4
bandit27@bandit:/tmp/tmp.iBw6J8BHf4/repo$ ls -ald /home/bandit27
drwxr-xr-x 2 root root 4096 Apr 10 14:22 /home/bandit27
리포지토리를 clone 하게 되면 패스워드를 요구한다. bandit27과 같은 패스워드를 사용하므로 문제 없다.
bandit27@bandit:/tmp/tmp.iBw6J8BHf4$ git clone ssh://bandit27-git@localhost:2220/home/bandit27-git/repo
Cloning into 'repo'...
The authenticity of host '[localhost]:2220 ([127.0.0.1]:2220)' can't be established.
ED25519 key fingerprint is SHA256:C2ihUBV7ihnV1wUXRb4RrEcLfXC5CXlhmAAM/urerLY.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Could not create directory '/home/bandit27/.ssh' (Permission denied).
Failed to add the host to the list of known hosts (/home/bandit27/.ssh/known_hosts).
_ _ _ _
| |__ __ _ _ __ __| (_) |_
| '_ \ / _` | '_ \ / _` | | __|
| |_) | (_| | | | | (_| | | |_
|_.__/ \__,_|_| |_|\__,_|_|\__|
This is an OverTheWire game server.
More information on http://www.overthewire.org/wargames
bandit27-git@localhost's password:
그러면 repo 디렉터리가 생성된다.
bandit27@bandit:/tmp/tmp.iBw6J8BHf4$ ls
repo
해당 디렉터리를 따라 들어가면 README 파일이 있다. 여기에 bandit28에 대한 크리덴셜이 들어있다.
bandit27@bandit:/tmp/tmp.iBw6J8BHf4/repo$ cat README
The password to the next level is: Yz9IpL0sBcCeuG7m9uQFt8ZNpS4HZRcN