How-To: Recover root password Ubuntu (Single mode)

Using GRUB, you can manually edit the proposed menu entry at boot time. To do so, when GRUB is presenting the menu list (you might need to press ESC first), follow those instructions:
  • use the arrows to select the boot entry you want to modify.
  • press e to edit the entry
  • use the arrows to go to kernel line
  • press e to edit this entry
  • at the end of the line add the word 'init=/bin/bash'
  • press ESC to go back to the parent menu
  • press b to boot this kernel
That should boot the machine into a bash console where you can get read/write access
to your /etc/shadow file.
You can then either run `passwd` or edit the shadow file directly to put in an empty string.
This allows you to reboot the machine into its normal environment and login as root .

leaving the password blank and then run the `passwd` program to set the root password.

ความคิดเห็น

บทความที่ได้รับความนิยม