1

I have Installed CentOS 7 x86_64 and I forgotten root password. After then I reset the password editing boot grub menu according How To Reset Root Password On CentOS 7 as follow. But after rebooting machine now I have no GUI or CLI login. What should I do ?

1 – In the boot grub menu select option to edit.

2 – Select Option to edit (e).

3 – Go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh.

4 – Now press Control+x to start on single user mode.

5 – Now access the system with this command.

chroot /sysroot

6 – Reset the password.

passwd root

7 – Update selinux information

touch /.autorelabel

8 – Exit chroot

exit

9 – Reboot your system

reboot
  • 1
    What is the exact error you are getting? – Mongrel Dec 30 '16 at 11:45
  • Nothing loaded. Stacked the console. This is a VM at Citrix cloud. – Chaminda Bandara Dec 30 '16 at 11:50
  • Are you able to see the grub screen again. – Mongrel Dec 30 '16 at 11:51
  • Thanks for correcting mistakes I have been made. No I can't see grub even. @Mongrel – Chaminda Bandara Dec 30 '16 at 11:56
0

Use theses steps to solve your issue.

  1. Interrupt the boot loader countdown by pressing any key.
  2. Move the cursor to the entry that needs to be booted.
  3. Press e to edit the selected entry.
  4. Move the cursor to the kernel command line (the line that starts with linux16).
  5. Append rd.break (this will break just before control is handed from the initramfs to the actual system).

Press Ctrl+x to boot with the changes and execute the following commands.

# mount -o remount,rw /sysroot
# chroot /sysroot
# chage -l root
# chage -E -1 root
# passwd root
# touch /.autorelabel

Type exit twice. The first will exit the chroot jail, and the second will exit the initramfs debug shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.