Single-User mode
Forget root password can use single user mode and rescue mode (this step must be completed in the Linux server physical machine or virtual machine, remote cannot be implemented, because of this, so to ensure the security of the server, because you have to complete this action in the room) here, the introduction of single-user mode, relatively simple.
1 Restart your server init 6, reboot, Shutdown-r now physical machine open, etc.,
2 After the start of the interface two options, we select the above, directly press E to edit,
3 Find the beginning of the Linux 16 line and the RO crashkernel ro permission to RW, and add init=/sysroot/bin/sh
That is, rw init=/sysroot/bin/sh crashkernel= ..... Slightly
4 after the modification, press Ctrl + x directly into the security environment, you can see this command line:/#
5 The current environment is not the original system environment/sysroot/is the previous system, so to modify:
:/# chroot/sysroot/
:/# passwd root (input lang_en if garbled)
:/# passwd Root Enter the new password to be modified
6 Required actions: Touch/.autorelable Create this file
Finally, if you are a virtual machine, restart the client in the virtual machine
If it is a physical machine, turn on the power OK
Note: The modified RW permission does not need to be changed back without the care of him.
This article is from the "13348833" blog, please be sure to keep this source http://13358833.blog.51cto.com/13348833/1970225
Forget Centos7 's Linux password