Ubuntu users are not in the sudoers file.

Source: Internet
Author: User
Ubuntu users are not in the sudoers file. when I set the virtualbox virtual machine in ubuntu last night, I was asked to add the user name to the vboxusers group, after I modify the user name of the [html] sudousermod-G group name, everything works. However, after the system is restarted... ubuntu users are not in the sudoers file. when I set the virtualbox virtual machine in ubuntu last night, I was asked to add the user name to the vboxusers group, after I modify the user name of the [html] sudo usermod-G group name, everything works. However, after the system is restarted, the system prompts: [html] the user name is not in the sudoers file, and this will be reported. Run the following command to view the group where the user name is located: [html]> cat/etc/group is similar to me: [html] giantchan: x: 1000 giantchan: x: 2311: vboxusers, that is, my users are moved from the root group to the vboxusers group. Therefore, the root permission cannot be obtained through sudo. After checking, the root permission of my system is not activated by me. That is to say, you cannot switch to the root account through su. There are three solutions: 1. modify/etc/group through su to obtain permissions again. If you have activated the root permission, you can switch to root to modify your group configuration. [Html]> vim/etc/group deletes the line of vboxusers username, and adds ": root" after your username number to add giatnchan back to the root group. Then modify/etc/sudoers [html]> vim/etc/sudoers to find the root ALL = (ALL) ALL row, and add the user name in the above format: username ALL = (ALL) ALL save and exit. 2. use LiveCD to modify/etc/sudoers. Use LiveCD to directly access the system, mount the system disk to the/mnt directory, and modify/etc/suders and/etc/groups as above. 3. after the instance is started, go to grub to modify it. P.S. 1 is used when you have not activated the root account. We recommend that you activate the root account after the fix is completed in case of no backup:> after su passwd adds the root account password, you can switch to the root account through su. Of course, we recommend that you do not use the same password as your common username to avoid confusion. P.S. 2 the correct command to add a user to a user group is: sudo usermod-G User Group-a user name, which is compared with sudo usermod-G User Group User name

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.