1. What if I forget the root password?
Using single-user mode
First step: Restart the Linux server
Restart command: Reboot,init 6,shutdown-r now
Shutdown command: Poweroff,init 0
OK, restart the server. Then enter the login screen
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/97/9A/wKiom1kwJffi1LQWAADM5oyOg9o846.jpg-wh_500x0-wm_ 3-wmp_4-s_3034605112.jpg "title=" snap1.jpg "alt=" Wkiom1kwjffi1lqwaadm5oyog9o846.jpg-wh_50 "/>
Use the upper and lower keys, select the red arrow, press the E key, enter the Grub interface, as follows
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/97/9B/wKioL1kwJk-S0lW0AADwKTdnw54422.jpg-wh_500x0-wm_ 3-wmp_4-s_2059105402.jpg "title=" snap1.jpg "alt=" Wkiol1kwjk-s0lw0aadwktdnw54422.jpg-wh_50 "/>
Then find the red Arrow place, as follows
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/97/9A/wKiom1kwJsbiVhX6AAEQKTW795k540.jpg-wh_500x0-wm_ 3-wmp_4-s_2425024351.jpg "title=" snap2.jpg "alt=" Wkiom1kwjsbivhx6aaeqktw795k540.jpg-wh_50 "/>
Modify the contents of the RO for RW init=/sysroot/bin/sh crashkernel=auto, and then ctrl+x, enter the following interface
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/97/9A/wKiom1kwJ5_AlQw0AACu58dQnBg033.jpg-wh_500x0-wm_ 3-wmp_4-s_901066711.jpg "title=" snap3.jpg "alt=" Wkiom1kwj5_alqw0aacu58dqnbg033.jpg-wh_50 "/>
Using the command ls/sysroot/root/
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/97/9B/wKioL1kwKAmBAdCFAADDytx4lAg929.jpg-wh_500x0-wm_ 3-wmp_4-s_2955386793.jpg "title=" snap4.jpg "alt=" Wkiol1kwkambadcfaaddytx4lag929.jpg-wh_50 "/>
Discovery is the same as the content in the normal system ls/root.
Use the command:
Chroot/sysroot
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/97/9A/wKiom1kwKvfTqd1UAADFGg9SdxI036.jpg-wh_500x0-wm_ 3-wmp_4-s_3708619030.jpg "title=" snap6.jpg "alt=" Wkiom1kwkvftqd1uaadfgg9sdxi036.jpg-wh_50 "/>
This is used, and you find the same as the normal system.
Use the command passwd root to change the password, and don't forget to modify the environment variable: lang=en
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/97/9A/wKiom1kwK3fzFH7hAAD-ZkFP59U605.jpg-wh_500x0-wm_ 3-wmp_4-s_134148352.jpg "title=" snap7.jpg "alt=" Wkiom1kwk3fzfh7haad-zkfp59u605.jpg-wh_50 "/>
Finally, don't forget a key command:
Touch/.autolabel
Finally restart the server, the password reverts to the password you just modified.
This scenario must be local, if the remote way is implemented not to come
Linux-centos7 How to recover a password