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

Implementation of installing Docker in win10 environment

1. Enter the Docker official website First, go to...

Pure CSS code to achieve flow and dynamic line effects

Ideas: An outer box sets the background; an inner...

MySQL Tutorial: Subquery Example Detailed Explanation

Table of contents 1. What is a subquery? 2. Where...

Practical operation of using any font in a web page with demonstration

I have done some research on "embedding non-...

Implementing simple tabs with js

Tab selection cards are used very frequently on r...

Use xshell to connect to the Linux server

Benefits of using xshell to connect to Linux We c...

Nginx access log and error log parameter description

illustrate: There are two main types of nginx log...

JS array loop method and efficiency analysis comparison

Array Methods JavaScript has provided many array ...

Implementation of whack-a-mole game in JavaScript

This article shares the specific code for JavaScr...

How to operate Linux file and folder permissions

Linux file permissions First, let's check the...

Examples of using temporary tables in MySQL

I've been a little busy these two days, and t...

Zabbix monitors mysql instance method

1. Monitoring planning Before creating a monitori...

Website Color Schemes Choosing the Right Colors for Your Website

Does color influence website visitors? A few year...