Forget Centos7 's Linux password

Source: Internet
Author: User

Single-User mode

Forget root password can use single user mode and rescue mode (this step must be completed in the Linux server physical machine or virtual machine, remote cannot be implemented, because of this, so to ensure the security of the server, because you have to complete this action in the room) here, the introduction of single-user mode, relatively simple.

1 Restart your server init 6, reboot, Shutdown-r now physical machine open, etc.,

2 After the start of the interface two options, we select the above, directly press E to edit,

3 Find the beginning of the Linux 16 line and the RO crashkernel ro permission to RW, and add init=/sysroot/bin/sh

That is, rw init=/sysroot/bin/sh crashkernel= ..... Slightly

4 after the modification, press Ctrl + x directly into the security environment, you can see this command line:/#

5 The current environment is not the original system environment/sysroot/is the previous system, so to modify:

:/# chroot/sysroot/

:/# passwd root (input lang_en if garbled)

:/# passwd Root Enter the new password to be modified

6 Required actions: Touch/.autorelable Create this file

Finally, if you are a virtual machine, restart the client in the virtual machine

If it is a physical machine, turn on the power OK

Note: The modified RW permission does not need to be changed back without the care of him.

This article is from the "13348833" blog, please be sure to keep this source http://13358833.blog.51cto.com/13348833/1970225

Forget Centos7 's Linux password

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.