Linux 7 to reset the root password

In the operation and maintenance work are often encountered do not know the password, the password is forgotten, the password is modified others cases, this way you clear away all the troubles!

1, start the Linux system, at boot interface appears, press the "e" key to enter the core editing interface;
2, found to have "linux16" to this parameter, enter "rd.break" at the end of paragraph;
3, then press "Ctrl + X" key combination to enter into the emergency mode;
4, a command line prompt, enter the following command

mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
exit
exit

5, after the system is restarted, the system can be used to enter the root password just set up

Note: passwd can be replaced echo "New Password" | passwd --stdin root, which looks more straightforward way to enter the password, to prevent the wrong, of course, if you stand behind a bunch of guys with bad intentions, you do not want them to know the password, do not use such an explicit way to change the password!

Guess you like

Origin www.cnblogs.com/chling/p/11498406.html