19
Reset Linux Root Password
Filed Under (Articles, Linux) by WebScHoLaR on 19-02-2008
Tagged Under : Linux, reset, root password
- Reboot the system and wait for the GRUB screen to appear.
- Highlight the kernel version you’re currently using (usually the newest version) from the GRUB list.
- Press “e” to be taken to the boot commands edit screen, highlight the line which starts with kernel and press “e” again.
- Add “single” to the end of the line, so it will look like this:
kernel /vmlinuz-kernel-version ro root=LABEL=/ rhgb quiet single
- Press “Enter” to save the changes
- Press “b” to boot in single user mode.
The system will begin loading and, at some point, you will be presented with a root bash prompt.
In the new prompt type “passwd” and choose a new password for root.When done, type reboot to restart the system. After reboot, GRUB will be back to normal so no further modifications are required.
NOTE: If you are asked for the root password before dropping you in a bash prompt in single user mode, you should follow the instructions above and append “single init=/bin/bash” to the kernel line, not just “single“.
