How to quickly modify the root password under CentOS8

How to quickly modify the root password under CentOS8

Start the centos8 virtual machine and press the up and down keys to select the first line in the interface in Figure 1

As shown in Figure 1

As shown in Figure 1

Press the 'e' key to enter the interface shown in Figure 2, and move the down arrow key to the line that begins with "linux16". Then press the right arrow key to move, find "ro" and change it to " rw init=/sysroot/bin/bash ". (There is a space after rw, and \ is added by the system itself), as shown in Figure 3.

As shown in Figure 2

As shown in Figure 2

As shown in Figure 3

As shown in Figure 3

Press and hold the Ctrl and x keys at the same time, and the system will enter the following interface, which is the emergency mode. As shown in Figures 4 and 5.

This interface has a long waiting time

As shown in Figure 4, the waiting time for this interface is relatively long, so you need to wait patiently.

insert image description here
As shown in Figure 5

4. Run the command " chroot /sysroot/ " to switch back to the original system (i.e. centos7), and then you can change the password. After changing the password, run the command " touch /.autorelabel " to make SELinux take effect and the password take effect. As shown below. (If the following garbled characters appear (vmware does not support Chinese characters, so squares are displayed), temporarily set the current terminal language to English). As shown in Figure 6.

/# chroot /sysroot/
	/# LANG=en (Change the language to English)
	/#passwd
	/# touch /.autorelabel 

insert image description here

As shown in Figure 6
5. Press and hold the "Ctrl+d" keys at the same time, enter "reboot", and press the Enter key to restart the system. As shown in Figure 7.


As shown in the figure

As shown in Figure 7

6. Enter this interface and enter the newly set root password to log in successfully. As shown in Figure 8.

insert image description here

As shown in Figure 8

7. Login successful and enter the centos8 system. As shown in Figure 9.

insert image description here

As shown in Figure 9

At this point, the root password of the centos8 system has been modified!

Summarize

This is the end of this article about how to quickly change the root password under CentOS8. For more relevant centOS8 root password cracking content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • CentOS 7 set grub password and single user login example code
  • How to change the password of mysql5.7.20 under linux CentOS 7.4
  • How to reset the root password in CentOS7
  • How to modify the root password of MySQL in CentOS environment
  • Solution to the problem of still having to enter a password after configuring ssh password-free login in centos
  • How to install and modify the initial password of mysql5.7.18 under Centos7.3
  • How to change mysql password under Centos
  • CentOS 7 Forgot Password Solution Process Diagram

<<:  How to draw the timeline with vue+canvas

>>:  A brief analysis of the tutorial on installing MySQL 8.0.18 on CentOS 6.8 (RPM method)

Recommend

Methods and techniques for quickly displaying web page images

1. Use .gifs rather than .jpgs. GIFs are smaller ...

Comparing Node.js and Deno

Table of contents Preface What is Deno? Compariso...

How to completely delete the MySQL service (clean the registry)

Preface When installing the executable file of a ...

HTML table tag tutorial (35): cross-column attribute COLSPAN

In a complex table structure, some cells span mul...

MySQL slow log online problems and optimization solutions

MySQL slow log is a type of information that MySQ...

js implements mouse switching pictures (without timer)

This article example shares the specific code of ...

Detailed explanation of MySQL binlog usage

binlog is a binary log file that records all DML ...

How to quickly modify the root password under CentOS8

Start the centos8 virtual machine and press the u...

js data types and their judgment method examples

js data types Basic data types: number, string, b...

Ten Experiences in Web Design in 2008

<br />The Internet is constantly changing, a...

Solve the installation problem of mysql8.0.19 winx64 version

MySQL is an open source, small relational databas...

Detailed explanation of HTML page header code example

Knowledge point 1: Set the base URL of the web pa...

Sample code for seamless scrolling with flex layout

This article mainly introduces the sample code of...

Modify the maximum number of mysql connections and configuration files in docker

1. Find the mysql image docker ps 2. Enter the mi...

How to use a field in one table to update a field in another table in MySQL

1. Modify 1 column update student s, city c set s...