9

I started to receive a message

dims is not in the sudoers file.  This incident will be reported.

about myself.

How could this happen?

The suspicious command I made was creating group "advanced" and adding myself to it.

addgroup advanced
usermod -G advanced dims

Could this break my sudo rights?

Nick ODell
  • 278
  • 2
  • 10
Dims
  • 1,763
  • 10
  • 33
  • 50
  • Post `groups` command output, this will print `dims` groups. – Lety Oct 19 '14 at 18:40
  • @VolkerSiegel While I think the questions are related, I'm not so sure this is a dupe. IMO Dims is asking *how* or *why* this happened, not how to fix it. The answer here wouldn't fit on the other question either, which is a strong suggestion they are not duplicates. – Seth Oct 20 '14 at 03:36
  • Related: [How do I add myself back as a sudo user?](http://askubuntu.com/questions/70442/how-do-i-add-myself-back-as-a-sudo-user) – Seth Oct 20 '14 at 03:37
  • @Seth I see - I was noticing that other question has an answer also mentioning the other groups - but it's more a related, and not strictly relevant to the "how comes" question (but very relevant to the "how to fix" question) – Volker Siegel Oct 20 '14 at 03:49
  • 1
    You might have dropped out of other groups too, see: http://askubuntu.com/a/59367/260447 – Volker Siegel Oct 20 '14 at 03:50
  • This is why it's best to avoid `usermod` and use `adduser`: `adduser `. – muru Oct 21 '14 at 12:34

1 Answers1

22

After

usermod -G advanced dims

the user dims is only a member of the group advanced but not of any other group. So as he isn't a member of the group admin or sudo he is no longer allowed to use sudo.

To just add a user to another group you need to use the -a switch to usermod, like

usermod -a -G advanced dims
Florian Diesch
  • 86,013
  • 17
  • 224
  • 214