CentOS 7 Forgot Password Solution Process Diagram

CentOS 7 Forgot Password Solution Process Diagram

need

Whether it is a Windows system or a Linux system, we may forget the password for various reasons. In order to preserve the data, it is not recommended to reinstall the system.

Experimental environment

1. CentOS 7 virtual machine

2. Change the password to 123456 (just for demonstration)

step

1. First, start the system and enter the boot interface. Press "e" in the interface to enter the editing interface.

2. Enter the editing interface, use the up and down keys on the keyboard to move the cursor down, find the line number that starts with "Linux16", and enter at the end of the line:
init=/bin/sh

3. Then, after the input is completed, just press the shortcut key: Ctrl+x to enter the single-user mode.

4. Then, in the new editing interface, enter "ls" at the end
ls

5. Next, enter the following in the position where the cursor is blinking (the position of the last line):

mount -o remount,rw /

Note: There is a space between mount and -o, and between rw and /. They cannot be omitted.

6 Then, enter: passwd at the end of the new line, and press the Enter key on the keyboard when you are finished.

7. In the pop-up content, you can modify the password. Enter the new password at the position where the cursor flashes (the password is not displayed when entering, just like no response. Just remember that the password you entered is correct. Press the Enter key on the keyboard after completion.

8. Then, enter the password you just entered again. After the password is successfully changed, the password will be displayed in the format of passwd....., indicating that the password has been successfully changed.

9. Input:

touch /.autorelabel

Note: There is a space after touch and /)

10. Restart the system

exec /sbin/init

11. Next, wait for the system to automatically change the password. After completion, the system will automatically restart.

12. Enter the root account and the modified password 123456 in the pop-up user name

Next, after a successful login, the interface will prompt detailed information of the last login. After a successful login, enter the system and open the terminal, and you can use it normally, indicating that the password has been successfully changed.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to quickly modify the root password under CentOS8
  • 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

<<:  The difference and usage of LocalStorage and SessionStorage in vue

>>:  Vue implements star rating with decimal points

Recommend

Solution to Tomcat server failing to open tomcat7w.exe

I encountered a little problem when configuring t...

Server stress testing concepts and methods (TPS/concurrency)

Table of contents 1 Indicators in stress testing ...

React+Typescript implements countdown hook method

First, setInterval is encapsulated as a Hook 👇 im...

WeChat applet calculator example

WeChat applet calculator example, for your refere...

Markup language - simplified tags

Click here to return to the 123WORDPRESS.COM HTML ...

A brief talk about JavaScript variable promotion

Table of contents Preface 1. What variables are p...

WeChat applet implements a simple calculator

WeChat applet's simple calculator is for your...

Analysis of the usage of Xmeter API interface testing tool

XMeter API provides a one-stop online interface t...

Minimalistic website design examples

Web Application Class 1. DownForEveryoneOrJustMe ...

The correct way to use Homebrew in Linux

Many people use Linux Homebrew. Here are three ti...

Vue implements a draggable tree structure diagram

Table of contents Vue recursive component drag ev...

Example of using @media responsive CSS to adapt to various screens

Definition and Use Using @media queries, you can ...