Method 1. add rwsingleinit/bin/bash to the kernel option at startup, and enter key B to enter the single-user mode passwd. enter the password ctrlaltdelete twice to restart. Then, enter passwd in RHEL5, the system did not respond ;...
Method 1. add rw single init =/bin/bash next to the kernel option at startup, then enter key B to enter single-user mode passwd, enter the password twice, press ctrl alt delete, restart, and then use RHEL5 then, input passwd, the system did not respond; remount the root partition; access to the sub-/bash shell still does not work. Method 2. the steps for starting the system are the same as those for RHEL5. enter setenforce 0 to make SELINUX in the warning state, and then enter the password twice. then, restart the system. Method 3 is OK. at the same time as the RHEL5 step, enter the single-user mode, and then enter: vim/etc/shadow to edit the file used to place all user passwords in the system. then, the second column of the following line is root: $6 $ hAp. jiX. p1h0cqbX $ skzofayl4pborlcbasqaayclx1_xksclyi. fyboYKRfjXGYuEziJZ0h0ejA5zi9xHt0/kGNsQDzz34wrrAJv1: 15184: 0: 99999: 7 ::: (delete the second column and click OK) in this way, the system root has no password!
This article is from the "Beat Yourself" blog