CentOS_7 Password Recovery / Single User mode
Password Recovery / Single User Mode (CentOS_7)
Steps:
1.) Reboot your server
2.) When it gets to your kernel at boot, hit "e" for edit mode
3.) Scroll down the page using the down arrow until you locate the line in the rescue script that has an 'ro'.
For me, it was toward the bottom, in the line starting with linux16 /vmlinuz-[the linux version number ending in].x86_64 root=dev/mapper/centos/root
4.) Change the ro to rw. Hit spacebar once. Type init=sysroot/bin/sh Leave a space between that and the next part "rd.lvm etc etc".
5.) Now you will be in single user mode. The shell prompt! -- lookslike :/#
6.) Hit Ctl-x
7.) Type chroot /sysroot
8.) Type passwd root
9.) Then appease SE Linux:
10.) Type touch /.autorelabel
11.) Type reboot
12.) Hit Enter
- 23738 Utilizadores acharam útil