redhat_ linux forgotten password (physical & virtual machine)

 Nothing is free, at home want to open a virtual machine to play, did not expect to forget the password. Ashamed ah! I remember to restart shutdown, then RO behind the data and then add rd.break.

And shift a long time, almost to the virtual machine ruined!

 

Eventually found, virtual and physical machines there are differences.

 

In the above physical machine directly engage rd.break 

On the virtual machine you have to add about console = tty0

Otherwise, you run ctrl + x to enter an emergency mode, it will error, it does not have permission to make the mount has been stuck there.

Will enter swich mode after the set up and execution 

 

mount -o remount,rw /sysroot

Execute the command: mount -o remount, rw / sysroot

 

Then after chroot / directory under sysroot

 

Perform change password

Change Password Enter password root

. . . . . . enter password

Or directly passwd 

touch /.autorelabel

exit

 

Guess you like

Origin www.cnblogs.com/caicai920/p/11100379.html