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

What if I forget the root password of the linux system?

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

Share

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

This article introduces the "linux system root password forgot how to do" related knowledge, in the actual case of the operation process, many people will encounter such a dilemma, then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

The rescue mode is rescue, which is mainly used in situations where the system is inaccessible. For example, grub is corrupted or one of the configuration file modifications is wrong. How to use rescue mode?

CD boot, press F5 to enter rescue mode

Enter linux rescue to enter enter

To choose a language, the author suggests that you choose English

Select us Keyboard

Here you are asked if you have started the network, and sometimes you may debug it online. We choose no.

This tells us that the system will be mounted in / mnt/sysimage next. There are three options, Continue is to mount and continue to the next step; Read-Only is mounted as read-only, which is more secure, sometimes when the file system is corrupted, read-only mode will prevent further damage to the file system; Skip is not mounted and enters a command window mode. Here we choose Continue.

At this point, the system has been mounted to / mnt/sysimage. Next, enter enter and enter chroot / mnt/sysimage to enter the administrator environment.

Tips: actually, you can change the password of root in rescue mode. This rescue mode is very similar to the windows PE system. After running chroot / mnt/sysimage/, ls sees that the directory structure is the same as the directory structure on the original system. That's right! The current environment is exactly the same as that of the original system. You can type exit or press Ctrl + D to exit the environment. Then you can take a look at ls.

This directory is actually the directory structure in rescue mode, and our system files are all in the / mnt/sysimage directory.

This is the end of the content of "the root password of the linux system forgot what to do". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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