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

How does CentOS reset the root password

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

Share

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

This article mainly introduces "how to reset root password in CentOS". In daily operation, I believe many people have doubts about how to reset root password in CentOS. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to reset root password in CentOS". Next, please follow the editor to study!

Preparatory work

Computer: install CentOS system

Software: VMware

Operation steps

The first step

Restart the CentOS system

Step two

On the VirtualBox main interface menu, click the Start button to start the virtual machine

Step three

When the grub menu appears, use the up and down keys to select the top startup item and press the letter e

The fourth step

Locate the linux16 line, press end on the keyboard, and position the cursor at the end of the line

Step five

Delete to ro, delete o, write w, and type the space rd.break, which means "rw rd.break" at the end of the line.

Then press Ctrl-x

Step six

Switch_root:/# chroot / sysroot

Chroot / sysroot, enter the prison / sysroot.

Sh_4.2# passwd root

Change the password of root

Sh_4.2# touch /. Autorelabel

Re-tag the file system with SELinux

Sh_4.2# exit

Get out of prison

Switch_root:# exit

At this point, the study on "how to reset the root password by CentOS" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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