Oh, My god! I forgot the root password after CentOS boot up and want to log on system. If no this account, I cannot do anything as install application or configure system later.
For resolving this problem, I dive into the Google Search to realize whether has method to do it. The answer is simple that there are three methods to resolve this problem.
(1). CentOS boot into single user mode
(2). Edit CentOS passwd file by Boot Disk/DVD/CDROM
(3). Another system boot and mount CentOS as drive next to change passwd file
In the moment, I think method (1) will be simple because doesn’t use other activity or utility. So the following procedure will introduce “How to reset root password by booting into single user mode? "
Power on the CentOS machine and press any key as ‘arrow’ or ‘space bar’ keys to enter the menu when you get this message.
Press e key to go into the second menu for editing the command (# 1)
Move cursor to the second line (kernel…) next to press e key once again
The screen will show up this command line and cursor will locate on the end of the line.
Press ← key and move cursor to “… ro root=…/VolGroup-lv_root…” this location
Add single key word next to press Enter key to return to “GNU GRUB Menu”
Press b key to reboot CentOS
Now it will stop at “#" command line
Type “passwd” to reset new password for root
Reboot this again
So does that root can log on to use new password now.
Reference:
(# 1) If it is booted at GRUN and type a key to modify kernel argument, we can append 1 or S key at the end of “…rhgb quiet” next to press Enter key to boot into single user mode.
沒有留言:
張貼留言