What if Linux forgets the password?

  
 

Introducing a method that can be used on all versions of linux grub:

1. On the Grub boot loader menu, select the entry you want to enter and type “e” to enter the edit Mode;

2, in the second line (similar to kernel /vmlinuz-2.6.15 ro root=/dev/hda2 ), type ”e” enter edit mode;

3, At the end of the sentence, add ”init=/bin/bash”, enter;

4, press “b” to start the system.

This way we can get a bash shell. After entering the shell, the root partition's mount mode is read-only by default. We need to change it to writable, otherwise we can't change the root password:

mount -no remount,rw /passwd root sync mount -no remount,ro /reboot

Copyright © Windows knowledge All Rights Reserved