Linux forgot root Password
We often encounter a situation where we forget the root password. Here is the solution,
This method uses the vast majority of Linux releases:
1. First go to grub
2. At the entrance to be edited, press e and add
Init =/bin/bash, press CTRL + x to start. Note: The quite here is generally
The most common online saying is that the second line specifies
That line. In fact, the current system may not be able to adapt.
For example, in my debian system, this line is displayed:
Linux/boot/vmlinuz-3.14.18 root... ro quiet
Therefore, we only need to add init =/bin/bash after the row quite
OK.
3. After the startup, run the following three commands:
# Mount-o remount, rw/
# Mount-
# Passwd root
If the system does not set the root password, go to the recovery mode.
And then execute the three commands mentioned above.
By the way, the method for adding a user to a sudo group is: usermod-G sudo username.