I forget my root login password of RHEL 7

Discuss Your Server Questions and Aswers

I forget my root login password of RHEL 7

Postby rameez » Mon Feb 23, 2015 11:41 am

Hi,

I know how to recover root password of RHEL-6 version, but in the same way I couldn't reset the password of RHEL-7 in Single Usermode. Kindly help me to reset the password. :cry: :cry: :cry: :cry:
rameez
 
Posts: 0
Joined: Tue Nov 25, 2014 5:17 pm

Re: I forget my root login password of RHEL 7

Postby rameez » Mon Feb 23, 2015 11:50 am

While google, I got a perfect answer.

1.Login to single user mode.
2.init=/bin/sh at the end of line that starts with linux in Grub2 (In case of VMWare like KVM or VirtualBox use rb.break instead of inti=/bin/sh)
3.run mount -o remount,rw /sysroot when the system boots
4.run chroot /sysroot
5.run passwd
6.run touch /.autorelabel
7.run exit to leave chroot
8.run exit to logout
rameez
 
Posts: 0
Joined: Tue Nov 25, 2014 5:17 pm

Re: I forget my root login password of RHEL 7

Postby m4tomson » Mon Mar 02, 2015 10:45 pm

You can break your booting and perform the following :

1. edit at the end of your kernel line as rd.break
2. #mount -o remount,rw /sysroot
3.#chroot /sysroot
4.change your root password using passwd command
5.#touch /.autorelabel
6.#exit -to exit from chroot
7.#exit -to logout and reboot.
m4tomson
 
Posts: 0
Joined: Tue Oct 28, 2014 5:15 pm


Return to Linux Server Configurations

Login  •  Register

cron