In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail about the virtual machine Linux system forget password change root or other user password how to do, editor feel very practical, so share to you as a reference, I hope you can get something after reading this article.
Working with scen
The linux administrator forgot the root password and needs to retrieve it.
Note: this article is based on the centos7 environment, because the version of centos is different, please determine the version before continuing.
Steps
First, restart the system, in the boot process, quickly press the keyboard direction keys ↑ and ↓. The goal is to tell the bootstrapper that we need to select a different action on the boot page in order for the bootstrapper to pause.
The following is the paused interface. You can check the English below to see the role of ↑ and ↓.
Use ↑ and ↓ to set the selected row to the first row (background highlight is selected), press e on the keyboard to enter edit mode
Move the cursor all the way to the back of LANG=en_US.UTF-8, a space, and then append init=/bin/sh. Note here that you need to write after UTF-8, keep it on the same line, and pay attention to the spaces. It is normal for some virtual machines to automatically add\ line breaks because the screen is too small.
4. Press CTRL+X to boot and enter the interface after success
Enter the following command
1. Mount the root directory
Mount-o remount, rw /
2. Select the user name for which you want to change the password. Here, select the root user to change it, and you can change it to the user you want to modify.
Passwd root
3. Enter the same new password twice, and note that there are no characters on the screen when entering the password.
If the password you enter is too simple, you will be prompted with a warning (BAD PASSWORD:Thepassword fails the dictionary check-it is too simplistic/systematic). You can ignore it and continue to enter the password, but it is recommended to set a more complex password to ensure security.
4. If you have enabled SElinux, you need to enter the following command
Touch /. Autorelabel
5. Finally, enter the following command to restart the system
Exec / sbin/init
About "virtual machine Linux system forgot password change root or other user password how to do" this article is shared here, I hope the above content can have some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.