본문 바로가기

programmer/Linux

[Linux] 우분투 root 비밀번호 초기화

[Linux] 우분투 root 비밀번호 초기화



우분투를 사용하면서 비밀번호를 잊어버리는 일이 종종 발생합니다.
부팅하면서 root 비밀번호를 바꾸는 방법을 알아보겠습니다.


.




1.



먼저 GRUB 부트로더의 복구모드로 들어가야합니다. 재부팅을 시작하면서 Shift키를 누르고 있으면 아래 그림같은 화면을 만날 수 있습니다.


enter image description here

Advanced options for Ubuntu를 선택합니다.


enter image description here


Ubuntu, with Linux ~ (recovery mode)를 선택합니다. 복구모드로 진입됩니다. 부팅이 될 때까지 기다립니다.


enter image description here


root - Drop to root shell prompt를 선택합니다.


enter image description here


그러면 아래에 명령어를 칠 수 있는 프롬프트가 생깁니다.


enter image description here

mount -rw -o remount /



원래는 읽기 전용 상태인데, 위의 코드를 입력하면 읽기와 쓰기가 가능해집니다.


enter image description here


비밀번호를 원하는 것으로 초기화시킵니다.