Solution to the unavailability of the Sudo command in Ubuntu

Source: Internet
Author: User
Article Title: Sudo command unavailable solution under Ubuntu. Linux is a technology channel of the IT lab in China. Some basic categories, such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems, are displayed as follows when using the sudo command:

Fafa211 is not in the sudoers file.

But obviously, it was usable before, that is to say, fa211 should be in/etc/sudoers before.

Cat/etc/sudoers

I found that I did not have the permission to view this file.

Only users in the admin group can use the sudo command.

Run the: cat/etc/group | grep admin command to check whether the fafa211 user is in admin. The result is obviously absent.

Why is the user name fafa211 not in the admin group? This is the user set during system installation.

Previously, the following command was used:

Sudo usermod-G wheel fafa211

Then I checked the detailed rules for using the usermod command.

The sudo usermod-G wheel fafa211 command only adds itself to a group, that is, in the wheel group.

Usermod will first Delete the user fafa211 from all groups, and then add it to the group list specified by the-G parameter. This design is.

The reason why the sound card cannot be used is this operation, and the sound card has no permission.

Solution:

Su root

Password:

Enter the password to enter the root user (if the root user is not set, restart the machine to enter the recovery mode)

Run the following command:

Sudo usermod-aG admin, dialout, dip, fax, cdrom, floppy, tape, audio, plugdev, and fafa211

Add yourself to the group. Restart and everything is back to normal.
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.