Retrieve Centos root User Permissions

Source: Internet
Author: User

Retrieve Centos root User Permissions

The last time I encountered this problem, my friend encountered this problem again today, I recorded it by the way:
The last time we encountered a problem on our server, the linux root User was lost. At that time, I found an article on the Internet and restored it. Today I will summarize it again:
Restart the server and enter the single-user mode. If the entire root user is lost, re-create the root user. The command is as follows:

Useradd-u 0-g 0-d/root-s/bin/bash root

Create root
-U 0-g 0 specify the root uid gid as 0
-D/root: Specify the root directory as/root.
-S/bin/bash specifies the root bash
Passwd root
Reset Password
Restart

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.