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

And reset the CentOS-root password

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, the editor will bring you about and reset the CentOS-root password. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

For a system administrator, the root password controls a considerable amount of security data. If you forget the root password, you need to get it back in time.

There are two main methods, both of which are very simple.

Method 1:

1. You can see the boot directory when you boot, use the up and down keys to select the system where you forgot your password, and then press "e".

two。 Next you can see the picture shown in the following figure, and then you use the arrow keys to select the kernel of *, and then press "e".

3. After performing the previous step, you can see the following screen, add "space" in rhgb quiet***, and then type "single", or enter the number "1" directly and enter enter to confirm.

4. Press the "b" key to reboot the system.

5. After the correction, reboot can be done.

Method two

Today, if I want to test a program, I will start centos5.2 on my virtual machine. As a result, I forgot my root password and couldn't use it.

Fortunately, I found a solution on the Internet. My excerpt is as follows:

GRUB:

On the bootloader menu, type the [e] key to enter edit mode.

You will see a list of pilot projects. Find a sentence line similar to the following output:

Kernel / vmlinuz-2.6.18-0.4 ro root=/dev/hda2

Press the arrow key until the line is highlighted, and then press the [e] key.

You can now press the space at the end of the text and enter: single and enter to tell GRUB to boot single-user Linux mode.

You will be taken back to the edit mode screen, from here, press the [b] key and GRUB will boot single-user Linux mode.

Sh-2.05#

Now, you can change the root command and type:

Bash# passwd root

You will be asked to retype your password to verify it.

Guide; then log in as the root user as usual.

If you want to know more about it, you are welcome to follow the industry information channel.

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

Servers

Wechat

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

12
Report