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

CentOS's root password forgot how to reset it.

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the CentOS root password forgot how to reset the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this CentOS root password forgot how to reset the article will have a harvest, let's take a look.

The way the centos 7 root password is reset is completely different from that of centos 6. Take changing the root password in single-user mode as an example.

1. Reboot, press esc, press e on the first line to edit

two。 Edit and modify two things: change ro to rw, and add init=/bin/sh after lang=en_us.uft-8

3. Press ctrl+x to restart and change the password

4. Since selinux is open, you need to execute the following command to update the system information, otherwise the password will not take effect after reboot.

Our department shuts down selinux

# vi / etc/sysconfig/selinux

5. Restart the system

# exec / sbin/init

Add: let's take a look at how to reset the centos 7.2 root password

Description:

This document has been successfully tested on centos 7.2kernel version 3.10.0 system.

-

First milestone-Select the edit option in the launch grub menu and press "e" to enter the edit

Second milestone-find "ro" around line 16 and change "ro" to "rw init=/sysroot/bin/bash"

Third milestone-press "ctrl + x" at the same time to enter single-user mode

The fourth milestone-- enter the system with the "chroot / sysroot" command

Fifth milestone-- "passwd root" reset root password

The sixth milestone-- updating selinux information with "touch / .autorelabel"

Seventh milestone-enter "exit" to exit chroot

Eighth milestone-restart your system with "reboot-f"

Ninth milestone-- Landing system Test

This is the end of the article on "CentOS's root password forgot how to reset". Thank you for reading! I believe you all have a certain understanding of the knowledge of "CentOS's root password forgot how to reset". If you want to learn more, 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

Development

Wechat

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

12
Report