Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does linux retrieve the root password

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces linux how to find the root password, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Retrieve the root password

If you forget the root password, you must reinstall the entire machine. To make matters worse, many people do so. But it's easy to start the machine and change the password. This does not apply in all cases (such as setting a GRUB password but also forgetting it), but here is a Cent OS Linux example that illustrates what you would do in general.

First, restart the system. The GRUB screen shown in figure 1 will pop up when you restart. Move the arrow keys so that you can stay on this screen instead of entering the normal startup.

Figure 1. Rebooted GRUB screen

Then, use the arrow keys to select the kernel to boot and type E to edit the kernel line. You can then see the screen shown in figure 2:

Figure 2: preparing to edit kernel lines

Use the arrow keys again to highlight the lines that start with kernel, and press E to edit the kernel parameters. When you reach the screen shown in figure 3, append the number 1 to the parameters shown in figure 3:

Figure 3. Append the number 1 to the parameter

Then press Enter and B, and the kernel starts to single-user mode. Then run the passwd command to change the user root password:

Sh-3.00# passwd New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully

Now you can restart and the machine will start with a new password.

Thank you for reading this article carefully. I hope the article "how to find the root password in linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report