After entering the Linux system (Ubuntu7.10) today, several problems suddenly occurred: 1. First, the sound card has no effect. 2. There is no way to use the sudo command. I thought it was strange. I thought it was a virus. However, if we think this is Ubuntu, it is not that easy to get involved. Moreover, there are very few viruses targeting Linux. So I checked on the Internet and found that many people encountered similar situations. The following message is displayed when you use the sudo command: fafa211isnotinthes.
After entering the Linux system (Ubuntu 7.10) today, several problems suddenly occurred:
1. The sound card has no effect.
2. There is no way to use the sudo command.
I thought it was strange. I thought it was a virus. However, if we think this is Ubuntu, it is not that easy to get involved. Moreover, there are very few viruses targeting Linux. So I checked on the Internet and found that many people encountered similar situations.
The following message is displayed when you use the sudo command:
Fafa211 is not in the sudoers file.
But obviously, it was usable before, that is, fafa211 should be in/etc/sudoers.
Cat/etc/sudoers
I found that I did not have the permission to view this file. Nothing can be done now. Without sudo, it's hard to get anywhere in Ubuntu!
On the Internet, we found that 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.
After thinking carefully, I used the following command yesterday afternoon to test the limit su command User:
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.