WSL(Windows Subsystem Linux)은 윈도우에서 리눅스(Ubuntu)를 이용하기 위해 사용됩니다.
저는 Ansible 이용을 위해 WSL을 사용했으나 비밀번호를 잊어버려 초기화 했던 방법을 공유하려고 합니다.
생각보다 간단해서 초기화 하는데 1분도 걸리지 않았습니다~!!
1. 윈도우 커맨드 창을 실행합니다.
2. 다음 명령어를 입력합니다. `wsl --user root`
ㄴC:\Users\chan>wsl --user root
[Root 비밀번호 변경 시]
root@HBPVG3010567:/mnt/c/Users/chan# passwd
New password:
Retype new password:
passwd: password updated successfully
[유저 계정 비밀번호 변경 시]
root@HBPVG3010567:/mnt/c/Users/chan# passwd chan
New password:
Retype new password:
passwd: password updated successfully
root@HBPVG3010567:/mnt/c/Users/chan# exit
logout
3. 변경된 비밀번호로 명령어가 실행되는지 확인합니다.
chan@HBPVG3010567:/etc/ansible$ sudo apt update
[sudo] password for chan:
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:2 http://ppa.launchpad.net/ansible/ansible/ubuntu focal InRelease [18.0 kB]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
...
[참고 사이트]
'Web' 카테고리의 다른 글
| [zsh] 유용한 플러그인 설치하기 (zsh-syntax-highlighting, zsh-autosuggestions) (3) | 2025.08.12 |
|---|---|
| [MacOS] 맥북 SSH 접속 셋팅하기 (+RSA Key) (0) | 2025.06.28 |
| [curl] HTTP,SSL 인증서 요청 확인하기 (1) | 2024.05.24 |
| [Web] Proxy Server의 개념 및 종류 (0) | 2021.10.14 |
| [Web] URL과 URI의 차이 (0) | 2021.09.10 |