Solve the problem that sudoers in Ubuntu crashes without the root permission

Source: Internet
Author: User
Tags superuser permission
1. Restart the Ubuntu system. Press and hold the Esc key to view the boot options. 2. You can see the boot options in the list, there is such (recoverymode) in the end brackets, that is, the recovery mode. Select this option and press enter to continue. 3. Load the data for a while and go to the RecoveryMenu page, you can see the following options: resumecleandpkgfsckgrubnetrootrootxifx select root, that is, enter the trial root user.

1. Restart the Ubuntu system and press the Esc key to view the boot options;

2. You can see that there is a recovery mode in the brackets at the end of the boot Option List, that is, the recovery mode. Select this option and press enter to continue;

3. Load the data for a moment and go to the Recovery Menu page. The following options are displayed:
Resume
Clean
Dpkg
Fsck
Grub
Netroot
Root
Xifx
Select root, that is, enter the trial root user to recover the system. In this case, you can perform the superuser permission operation.
After you press enter, you can see the familiar
Root @ TUZKI :~ #
Command prompt.

4. Set or revoke the/etc/sudoers file permission
At this point, you can execute:
Chmod u-w/etc/sudoers
Revoke the w permission on the/etc/sudoers file. I directly added the root w permission and added the user shirdrn to the/etc/sudoers file.
Root ALL = (ALL) ALL
The following line is added under this line:
Shirdrn ALL = (ALL) ALL
This makes the user shirdrn a user in the sudo group and can execute super permissions.
Log out of recovery mode and restart the system. After entering, you can use the shirdrn user to create the/home/shirdrn directory:
Sudo mkdir/home/shirdrn
Because the shirdrn is already a user in the sudo group, run the cd ~ Run pwd to view the/home/shirdrn directory of the shirdrn user.

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.