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

Centos7 reset root password for Linux

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

Share

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

There are two ways:

I.

1. Check the version number of the system first, which is version 7.7.

2. Restart the system

3. Press E after reboot or boot

4. Add rd.break after UTF-8, and then press ctrl+x

5. Enter the emergency rescue mode of the system

6. Enter the following command in turn and enter the password

7. Enter the password, but do not display it

8. Enter the following command. After restarting, you can use the bar to set a new password to log in to the root account.

9. All the commands entered are shown as follows:

Method 2:

1. Press E after reboot or boot

2. Then press the down arrow to find the line that begins with "Linux16", and type "init=/bin/sh" at the end of the line

3. Then press the "ctrl+X" key combination to enter single-user mode

4. Then enter "mount-o remount,rw /" (notice the space between mount and-o and between rw and /) and passwd

5. Enter a new password

6. Enter touch / .autorelabel, enter exec / sbin/init, and enter enter

7. Restart and enter the new password to enter the system

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