Blog History

July 19, 2018

CentOS 7 reset root password

So after a unknown mistype on a Sangoma PBXact system running CentOS 7 when changing the root password, I was locked out. Unfortunately, many of the tutorials were either for CentOS 5 or 6, or they made no sense to me with long complicated steps. Thankfully, I found this post: https://www.unixmen.com/reset-root-password-centos-7/

Steps were simple:
  1. In the boot grub menu select option to edit: e
  2. Go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh
  3. Now press Control+x to start on single user mode.
  4. Now access the system with this command: chroot /sysroot
  5. Reset the password: passwd root
  6. Update selinux information: touch /.autorelabel
  7. Reboot your system
....but oddly plugged into the box with a monitor it was stuck on:
"Probing EDD (edd=off to disable)"
After trying it a couple times, for the heck of it I plugged in a console cable and tried through Putty on my ThinkPad. Lo and behold, the VGA monitor was stuck still, but my Putty session showed the root bash! Root password changed, disaster averted.

No comments:

Post a Comment