September 23, 2021

Decrypt Info

Because we care, we're security aware.

Do you Forgot Password For RHEL 7 Or CENTOS 7? 7 Steps to recover it

0 0
2 min read
Reset-password-decryptinfo
0 0
Read Time:1 Minute, 37 Second

Forgot your RHEL 7 or CentOS 7 Linux root password? Do you want to recover it? Follow 7 easy steps to gain root user access.

Note: This procedure must be performed from a console session. The system is using the default grub2 bootloader and grub is not being password protected and this procedure cannot be accomplished over any SSH remote session. To see the grub bootloader boot options is mandatory and using the procedure below, it can only be done through a console session, not with an ssh session

Step 1

Step one is to reboot the system and edit the grub2 parameters. Press ‘e’ before the menu times out and boots normally.

Boot menu

Step 2

Look for a line that mentions linux16 (or linuxefi if you are using UEFI bios). You may need to use the arrow keys to scroll down.

rhgb-quiet-decryptinfo

At the end of the linux16 or linuxefi line, find and replace the rhgb quiet parameters with rd.break enforcing=0 as shown below

 

rd.break-enforcing-decryptinfo

After the above changes hit Ctrl+x. to reboot and see the effects. The system should boot into the root system.

shell-password-recovery-decryptinfo

Step 3

Remount system as read/write

Enter the following command to remount the sysroot filesystem as read/write:

mount -o remount,rw /sysroot

Step 4

Change root to sysroot

Now we using chroot command into the sysroot, using the following command: chroot /sysroot

Step 5

Change the password

We can use the passwd command to change the root password.

Step 6

Exit from the shell and remount sysroot

Enter the following command to bring control back to the switch_root:/# prompt:

exit

And execute the command to remount the sysroot filesystem as read-only once again:

mount -o remount,ro /sysroot

mount-password-recovery-linux-decryptinfo

Step 7

Exit session and reboot

After all the processes enter the exit command and the system will prompt for login/password.

You can login system with a new password which you set in step 5.

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply