Change the root password in Ubuntu Linux with an unknown root Password
A simple and practical way to change the root password in the history of Ubuntu/Linux without knowing the root password
Generally, there are two steps:
1. Enter the read/write root user mode. 2. Change the root password.
Press F12 (or Shift) To Go To The GRUB page.
1. Select Advanced options for Ubuntu
2. Two modes are displayed,
1. Ubuntu, Linux 3.5.0-17-generic
2, Ubuntu, Linux 3.5.0-17-generic (recovery mode) (or recovery mode)
In recovery mode, press e to go to the script editing interface in Ubuntu recovery mode,
Find the following statement: It starts with linux, followed... Ro recovery nomodeset
Change ro recovery nomodeset to rw single init =/bin/bash
Note: If this parameter is not modified, the file cannot be modified after entering the root directory.
The preceding modification is to change to readable and writable single-user mode, and press Ctrl + x to enter single-user mode. At this time, the user is the root user.
The above steps are used to enter the read/write root user mode. The following steps are to change the root password.
After entering the command line, enter the new root password and execute passwd root in the command line to enter the new password twice.
At this time, the original root password will always go with the wind, and only God knows that it has existed and troubled us, just like the girl we secretly loved when we were young. finally, restart the system. BTW: the above method is applicable when you do not know the root password and any user password, for example, get a PC, do not know the boot password. if a user's logon password is known, you can use sudo passwd root to enter the current user's password to change the root password.