How to retrieve Ubuntu login password after forgetting

It has been useless for a long time. When I log in to Ubuntu again , I am reminded that the password is wrong, and then I enter the guest session. I can still enter the system to work but my identity is a guest, so I start the long road to recover the password.

First of all, in the guest mode, there is an option in the upper right corner to return to your own user mode, but you still need to enter the password. If you enter the wrong one, you will enter the guest again. After trying several passwords over and over again, I found that I couldn't find them. The only way is to set a new password through the system and log in again with the new password.

1. After Ubuntu boots, long press the shift key to enter the grub menu

2. Select recovery mode, enter

3. Select root drop to root shell prompt in the recovery menu, enter

4. ​Enter the shell interface and use the passwd command to set a new password: passwd syt (syt is the user created by the system and the user who wants to retrieve the password)

5. Enter the new password, enter the new password again, and see that password updated successfully is successful

6. This is the point I am talking about, there is an authentication token manipulation error

passwd unchanged

7. There are many solutions on the ​authentication token manipulation error on the Internet about what file operations to modify or the memory partition is not enough, but mine is a very simple one, because there is no permission!

8. Enter "mount -o rw,remount /" on the command line

9.​Step8 After obtaining the permission to change the password, repeat step4 and step5, and you will see a successful prompt.

10. Restart after sudo reboot, enter the new password to log in to the syt user you are looking for​

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326171911&siteId=291194637