📌 문제 설명
bandit0의 홈 디렉터리 아래에 있는 readme 파일 안에 bandit1의 비밀번호가 들어있다고 한다.
해당 비밀번호를 이용하여 bandit1에 ssh 접속을 하면 된다.
이 문제를 통해 파일을 읽는 방법에 대해 정리해보자
📌 풀이
파일을 읽을때는 cat 명령어를 이용해서 읽으면 된다.
이렇게 비밀번호를 확인했다면 서버에 bandit1 이라는 유저 아이디로 로그인을 해야하기 때문에, 현재 로그인 되어있는 bandit0에서 로그아웃 해줘야한다.
bandit0@bandit:~$ ls
readme
bandit0@bandit:~$ cat readme
Congratulations on your first steps into the bandit game!!
Please make sure you have read the rules at https://overthewire.org/rules/
If you are following a course, workshop, walkthrough or other educational activity,
please inform the instructor about the rules as well and encourage them to
contribute to the OverTheWire community so we can keep these games free!
The password you are looking for is: 비밀번호
bandit0@bandit:~$ logout
$ su - [유저네임]
위 명령어을 입력하면 로그아웃 하지 않아도 바로 사용자를 바꿀순 있지만, 워게임에서는 안될것이기 때문에 재접속을 하자.
터미널을 새로 열어서 bandit1으로 재접속 한다.
$ ssh bandit1@bandit.labs.overthewire.org -p 2220
| |__ __ _ _ __ __| (_) |_
| '_ \ / _` | '_ \ / _` | | __|
| |_) | (_| | | | | (_| | | |_
|_.__/ \__,_|_| |_|\__,_|_|\__|
This is an OverTheWire game server.
More information on http://www.overthewire.org/wargames
bandit1@bandit.labs.overthewire.org's password : 아까 봤던 비밀번호 입력
📌 정리
파일은 cat 명령어를 이용해서 읽는다.
cat 명령어의 옵션들은 한번씩 읽어보기
'OverTheWire > bandit' 카테고리의 다른 글
Bandit Level 5 → Level 6 (0) | 2025.01.11 |
---|---|
Bandit Level 4 → Level 5 (0) | 2025.01.10 |
Bandit Level 2 → Level 3 (0) | 2025.01.10 |
Bandit Level 1 → Level 2 (0) | 2025.01.10 |
Bandit Level 0 (0) | 2025.01.10 |