In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to change the root password under Linux", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to change the root password under Linux" this article.
Linux can modify the root password by: 1, when the user has sudo authority, you can change the password directly; 2, when you do not have the authority, you can press the Shift key for a long time to enter the Ubuntu advanced option in the GRUB map mode and configure it.
Change the password of administrator root under img 1 and Redhat6 (same as Centos6)
1. If it is a production line server, we need to apply for a shutdown window to restart the server. The moment the server turns on the power and enters the system bios power-on self-test, we must quickly press the up and down keys of the keyboard to enter the following interface.
Linux system root password reset Linux system root password reset
2. At this time, we press the "E" key of the keyboard to enter the system boot boot editing interface. We use the keyboard up and down keys to select the kernel kernel line, as shown in the following figure:
3. After selecting the kernel kernel line, we press the "E" key again according to the prompt below. After entering the editing interface, enter "1" or "single" in the space behind quiet to tell the system that I want to enter single-user mode, as shown in the following figure:
4. After entering "1", we press the enter key of the keyboard, and then press the "b" key of the keyboard to enter single-user mode, as shown in the following figure:
5. After entering the single-user mode, we can execute the command to change the root password. You can enter the command directly: passwd or enter passwd root to change the password, as shown below:
6. The last step is to restart the system by reboot. Is it very simple? next, let's see how to change the root password under Centos7.
2. Modify root password under Centos7 (same as Redhat7)
1. As above, restart the system first, press and hold the up and down keys of the keyboard to enter the system configuration boot interface, as shown in the following figure:
2. Select the first line by default, and then press the "e" key of the keyboard to enter the editing interface, as shown in the following figure:
3. In the editing interface, we find the line linux16, find "ro", and replace "ro" with "rw init=/sysroot/bin/sh", as shown in the following figure:
4. After modification, we press the keyboard "Ctrl + x" key to enter single-user mode, as shown in the following figure:
5. Then we enter the command "chroot / sysroot" to access the system, and then enter passwd root to change the password. After the modification, we enter the command "reboot" to restart the system and use the new password to log in to the system! As shown in the following figure:
The above is all the contents of the article "how to change root password under Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.