Page 1 of 2
CentOS 6 & 7 forgot the root password modification scheme
Posted: Thu Apr 18, 2019 10:33 pm
by lanzi
The root password modification of Linux is different from the password modification and retrieval of Windows. The login password of Windows needs to be solved by intervention tools if forgotten. CentOS6 and CentOS7 also have different password methods, as follows:
The practice proves that the following scheme is feasible
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Thu Apr 18, 2019 10:34 pm
by lanzi
The first is a root password change for CentOS 6
Boot press esc
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Thu Apr 18, 2019 10:35 pm
by lanzi
Press e to enter edit mode
Choose the Kernel/vmlinz 2.6.32-696 e16... ... Then press e to edit this item
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Thu Apr 18, 2019 10:36 pm
by lanzi
Once in edit mode, type simple or 1 after quiet and press enter
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Thu Apr 18, 2019 10:37 pm
by lanzi
Press b to enter single user mode
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Fri Apr 19, 2019 2:50 am
by lanzi
Passwd root
Enter the new password twice
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Fri Apr 19, 2019 2:51 am
by lanzi
Reboot to restart
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Fri Apr 19, 2019 2:52 am
by lanzi
Log in with the new password after reboot
The root password change for CentOS 6 is complete
Below is the root password change for CentOS 7
Boot press esc
Select CentOS Linux (3.10.0-693... Press the e key
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Fri Apr 19, 2019 2:53 am
by lanzi
Move your cursor over the line beginning with Linux 16 and find ro changed to rw init=sysroot/bin/sh
Re: CentOS 6 & 7 forgot the root password modification scheme
Posted: Fri Apr 19, 2019 2:54 am
by lanzi
Press Ctrl + x
Enter chroot /sysroot