How to quickly modify root password under CentOS8

Turn on the centos8 virtual machine, press the up and down keys in the interface of Figure 1 to select the first line

As shown in Figure 1

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

as shown in picture 2

As shown in Figure 3

Hold down the Ctrl and x keys at the same time, the system enters the following interface, namely emergency (emergency) mode. As shown in Figures 4 and 5.

As shown in Figure 4, this interface has a long waiting time, so be patient.

As shown in Figure 5

  1. Run the command "chroot /sysroot/ " to switch back to the original system (centos7), and then you can modify the password. After modifying the password, run the command "touch /.autorelabel" to make SELinux effective and the password effective. As shown below. (If the following box is garbled (vmware does not support Chinese characters, so the box is displayed), temporarily set the current terminal language to English). As shown in Figure 6.
/# chroot /sysroot//# LANG=en (change language to English)
	/# passwd
	/# touch /.autorelabel

As shown in Figure 6
5. Hold down 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 Figure 7

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

As shown in Figure 8

  1. Log in successfully, enter the centos8 system. As shown in Figure 9.

As shown in Figure 9

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

Recommended Posts

How to quickly modify root password under CentOS8
How to quickly build Nginx server under CentOS
Root password cracking under CentOS 7
How to modify the hostname on CentOS 8
How to change MySQL password under Ubuntu
How to modify the CentOS server time to Beijing time
How to change root user password on Ubuntu
How to quickly install docker on Linux (Centos version)
CentOS 7 Root user password reset
How to learn python quickly
How to set or modify the time zone in CentOS 8
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to Update to gcc4.9.x on Centos7
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install PHP7.4 in CentOS
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to compile ijkplayer-android under ubuntu
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install HDP2.6 in Centos7.2
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to add swap on CentOS 7
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to disable SELinux on CentOS 8
Modify CentOS server time to Beijing time
How to install OpenCV on CentOS 8
How to install Audacious under Ubuntu
How to install PHP on CentOS 8
How to install Tensorflow under ubuntu 16.04
How to install MongoDB on CentOS 8
How to extend the root directory of LVM under Ubuntu system
How to install Android SDK in centos7