Enter the single user status in centos7 to change the root password

Source: Internet
Author: User
I recently started to learn about linux. as a newbie, I want to write a blog to record my learning experience and count it as a note. I encourage you to not talk much about it. Here we will introduce the init method Step 1: Press the keyboard at startup, and go to the following menu Step 2: Select the first item, and press the e key to modify (in the boot options) Step 3: Find ro, step 4: change ro to rwinit =/bi

I recently started to learn about linux. as a newbie, I want to write a blog to record my learning experience and count it as a note. I encourage you to not talk much about it. The init method is described here.

 

Step 1: Press the keyboard to go to the following menu

Step 2: select the first item and press the e key to modify it (at the boot option)

Step 3: Find ro,

Step 4: change ro to rw init =/bin/sh

Step 5: As shown in, delete the rhgb quiet in the last and second rows of this section, press Ctrl + X to save and start the system.

Step 6: change the root password

# Passwd root # change the password, and then prompt to enter a new password and confirm the password again

# Touch/. autorelabel # It is said that selinux updated the label after restarting

# Exec/sbin/init # Start the init process normally

 

Note: If you perform the above command line operations in Chinese mode, garbled characters may occur. the solution is as follows:

$ Echo $ LANG (display the current language) (the first dollar sign is a system symbol and does not need to be edited by yourself. it is # Under root permission #)

$ LANG = en_US (English, Chinese: zh_CN)

$ Echo $ LANG (if you execute the first command again, it will show that you are using en_US, indicating English), OK, success

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.