RHEL7 ROOT password reset

The first step, boot the system and press any key to interrupt the normal boot process, then you will see the screen shown below. Here, select GRUB option (in the following snapshot highlighted in blue), then press the "e" to edit
RHEL7 ROOT password reset
the second step, change the kernel
RHEL7 ROOT password reset
in here to go to end of the line, and then write the word UTF-8 behind rd. break console = tty0 (highlighted in blue in the following snapshot), and then press Ctrl + x to continue processing. Follow these snapshots.
RHEL7 ROOT password reset
After pressing Ctrl + x, enters the console, as shown in the following snapshot.
RHEL7 ROOT password reset
The third step is the authorization / sysroot write permissions
here, we need to use the rw (read / write) permission to mount / sysroot to reset the root passwd, because by default / sysroot in ro (read only) permissions model
that we can use mount command check, the following snapshot.

RHEL7 ROOT password reset
So let us use the following command rw (read / write) permission to mount / sysroot
RHEL7 ROOT password reset
As we can see in the following snapshot now / sysroot have rw (read / write) permissions
RHEL7 ROOT password reset
Now, type the command chroot here / sysroot / directories as root and redirect you to the shell prompt shown below.

sh-4.2#

The fourth step, reset the root password
so now we have a Shell Prompt. Here, we can use the passwd command to reset the root password linux, as shown in the following snapshot
RHEL7 ROOT password reset
As we have seen in the snapshot as, root password has been updated successfully run the following command to automatically SElinux relabel the file system.
RHEL7 ROOT password reset
Then run the exit command to exit from the Shell Prompt, and then run the reboot command to reboot the system

Guess you like

Origin blog.51cto.com/84599/2445243