How to reset the password if the Ubuntu 18.04 server password is forgotten or tampered with

How to reset the password if the Ubuntu 18.04 server password is forgotten or tampered with

Recently, two accounts on the server were hacked and their passwords were tampered with. Fortunately, there was still an account that could be used, and I could confirm that the original account still existed. So the first thing I thought of was to change the tampered password. Finally, it took me five hours to solve the problem. It might be the first time I encountered this kind of problem, so I was slow to get started. Without further ado, I’ll get straight to the point. . .

In fact, you can search many blogs on how to change passwords on the Internet, but they are not very practical. Moreover, on the AMAX server, I followed the methods of my predecessors, but the first step always didn't work. Finally, I accidentally saw a sentence in other posts and combined with some of the previous posts, and finally solved the problem. The detailed steps are as follows:

first step:

First, confirm how to enter GNU GRUB on your machine. This step is very important. Many machines require you to hold down Shift when booting up, but our machine requires you to press Esc. And it is best not to hold down Esc, as this will easily lead to the GRUB command line input interface. So it is best to keep pressing Esc and let go when you see a black screen. The interface you enter is as shown below. Select "Advanced option for Ubuntu" and press Enter.

Step 2:

Select (recovery mode), do not click Enter, do not click Enter, press the E key to enter the next interface.

Step 3:

Change the "recovery nomodeset" in the red box to "quiet splash rw init=/bin/bash"

Step 4:

Then press F10 or Ctrl+x to display the following interface. Enter passwd in the command line to change the password.

Step 5:

After shutting down or forcing a shutdown, you can log in with the newly set password.

Summarize

The above is what I introduced to you about how to reset the password of Ubuntu 18.04 server if the password is forgotten or tampered with. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to reset mysql server root password in ubuntu
  • Ubuntu 16.04 server configuration ssh password-free login

<<:  Springboot+VUE to realize login and registration

>>:  Detailed tutorial on installing mysql 8.0.13 (rpm) on Centos7

Recommend

JavaScript event delegation principle

Table of contents 1. What is event delegation? 2....

Get the calculated style in the CSS element (after cascading/final style)

To obtain the calculated style in a CSS element (t...

js uses FileReader to read local files or blobs

Table of contents FileReader reads local files or...

Three common ways to embed CSS in HTML documents

The following three methods are commonly used to d...

Detailed explanation of MySQL user rights verification and management methods

This article uses examples to illustrate how to v...

Sample code for using CSS to write a textured gradient background image

The page length in the project is about 2000px or...

Two box models in web pages (W3C box model, IE box model)

There are two types of web page box models: 1: Sta...

How to create a responsive column chart using CSS Grid layout

I have been playing around with charts for a whil...

Implementing parameter jump function in Vue project

Page Description:​ Main page: name —> shisheng...

How to export mysql query results to csv

To export MySQL query results to csv , you usuall...

IE6 space bug fix method

Look at the code: Copy code The code is as follows...