[kwlug-disc] I'm "not in sudoers file."

Chris Craig kwlug.org at ciotog.net
Thu Mar 30 07:54:11 EDT 2017


On 30 March 2017 at 03:34, Ronald Barnes <ron at ronaldbarnes.ca> wrote:

> usermod -G (--groups) to add user to new group(s) REQUIRES the -a (--append)
> option if one is not willing to manually specify all the groups the user is
> to be in as arguments to usermod.
>
> Apparently, it keeps you in your default group that matches your username
> though.

Using simply 'usermod -G' to add a user to a group is a very common
piece of misinformation. Personally I use 'gpasswd' to manage groups.
Adding a user to a group would be:
$ sudo gpasswd -a <user> <group>

> Anyone have a handy list of the default groups for a normal user on Ubuntu
> 16.04?

Even better, here's the list of groups you were added to when your
account was created:
$ sudo grep user-setup /var/log/installer/syslog

You could also create a throwaway user, and use 'groups' on their account.

This won't tell you any additional groups added by install scripts
(for cups, samba, etc), but they become apparent soon enough.




More information about the kwlug-disc mailing list