RHEL8 reset root password

RHEL8 reset root password

Step 1: Restart the Linux system host and the boot interface appears, press the "e" key on the keyboard to enter the kernel editing interface, as shown in the following figure.

Chapter 1 Hands-on deployment of a Linux operating system Chapter 1 Hands-on deployment of a Linux operating system

Step 2: Add the "rd.break" parameter to the end of the linux parameter line, and then press the "Ctrl + x" key combination to run the modified kernel program, as shown in the figure below.

Chapter 1 Hands-on deployment of a Linux operating system Chapter 1 Hands-on deployment of a Linux operating system

Step 3: After about 30 seconds, enter the emergency mode of the system, as shown in the figure below.

Chapter 1 Hands-on deployment of a Linux operating system Chapter 1 Hands-on deployment of a Linux operating system

Step 4: Enter the following commands in sequence, and then press the "Ctrl + d" key combination twice to exit and restart. After the system restarts again, you can use the new password to log in to the Linux system. The command execution effect is shown in the figure below.

mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel

Chapter 1 Hands-on deployment of a Linux operating system Chapter 1 Hands-on deployment of a Linux operating system

Guess you like

Origin blog.csdn.net/weixin_45603370/article/details/112389687