Centos7 forgot root Password change

Source: Internet
Author: User

When using the Linux system have not encountered the forgotten root password situation, if you encounter such a situation, what should we do? Do you want to reinstall the system? Of course not! Simply change the root password by going to single-user mode. How to get into it? The following is the whole process of Centos7 changing passwords through single-user mode.

1. When the Grub menu is started, select the Edit option to start

2. Edit the options we selected by e key

3, in the "RO" position, "ro" replaced by "RW init=/sysroot/bin/sh"

4. Press Ctrl+x through the keyboard to enter single-user mode, then change the root password

Chroot/sysroot   # Use chroot command to access system passwd root # Change root password Touch/.autorelabel  # Update System info exit # Exit Chroot mode reboot # Reboot system

Centos7 forgot root Password change

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.