[Ubuntu] What should I do if I forget the root password of Ubuntu?

What should I do if I forget the root password of Ubuntu?

  • In the Ubuntu 16.04 system, the administrator password is lost or invalid due to misoperation, and the root password is forgotten. At this time, no root/sudo privilege operations can be performed. You can reset the root password through GRUB and restore the administrator account to a normal state.

tool

  • Ubuntu16.04操作系统

Reset root password

  • Start the system, display the GRUB selection menu (long press the shift key), and enter the selection interface.

  • Select (advanced settings) enter key
    **image**

  • Boot to select advanced mode -> recovery mode (the newest one) -> root (directly press enter)
    image
    image

  • Set the password as required. Manage passwords.
    command:Passwd root # 修改密码(这里修改的密码不去使用)
    image

  • After the modification is completed, shut down and restart

  • After the implementation of the system to re-enter sudo passwd rootthe password change again. -The password is the new password
    Insert picture description here

  • carry out!


Guess you like

Origin blog.csdn.net/qq_45797116/article/details/114489678