Linux-Ubuntu forget the user password solution

[System version]: Ubuntu 12.04

【Solution】:

  1. Restart the system, press and hold the shift key to enter the grub menu;

  2. Select recovery mode recovery mode;

  1. Select root drop to root shell prompt in the recovery menu;

  1. Enter passwd username in the command line;

If the word “successful” appears, it means that the modification is successful. If it is like the above, it means that the modification is not authorized.

The solution at this time:

Remount the root directory / in read-write mode, enter mount -o rw,remount /

Change the password again to succeed.

  1. The above is to modify the user name and password, modify the root password: passwd "user name", and then type the password twice to modify the user name and password.

About mount -o rw,remount /

It should be noted that the mount point must be an existing directory, and this directory may not be empty. Generally used for files in this directory is ro permission, which needs to be temporarily changed to modifiable permission.

parameter:

Recommended Posts

Linux-Ubuntu forget the user password solution
CentOS 7 Root user password reset