Linux Learning Notes (vii)---CentOS7 single-user mode

Source: Internet
Author: User
In CentOS7, there is a single-user mode, similar to the security mode under Windows. If we forget the root password, we can reset it in single-user mode.
Note: This operation must be done in front of the server and cannot be operated remotely.
1. Restart the machine, in the system login Select interface, press the arrow key. Select the entry that is normally logged in, and then press the E key as shown:

2. Enter the grub editing interface. linux16 this line of RO modified to RW init=/sysroot/bin/sh.

3. Press Ctrl+x to enter single-user mode

4. After logging in, enter the following command:
chroot/sysroot/#切换到原系统
Lang=en #设置显示语言
passwd Root #修改root密码
Touch/.autorelabel #如果之前系统关闭selinux, this can not be done.

5. Reboot the system and login with the new password.

Linux Learning Notes (vii)---CentOS7 single-user mode

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.