The default groups are:
{user} adm cdrom sudo dip plugdev lpadmin sambashare
Where {user} is your username.
When adding new groups to your user on the command-line, to avoid losing membership of other groups, use:
sudo usermod -aG {group1},{group2},{group3} {user}
The -a
option of usermod
appends the new group onto your user's list of groups, without that you'll overwrite all other groups.
Unfortunately, as you've taken yourself out of the sudo
group, you won't be able to complete this command. If you have another sudo user on the system that you have access to, you could use them to reset your groups, otherwise you will need to boot to recovery, and drop to a root shell, to recover the groups using the usermod
command above, although as root, you won't need sudo
.
$ id uid=1000(zanna) gid=1000(zanna) groups=1000(zanna),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),129(sambashare)
– Zanna Jul 25 '16 at 13:14