Recently I accidentally executed the usermod
command to add a group to my user; unfortunately I forgot the -a
operator, so the command removed all the other groups from my user.
After next login I recognized that I cannot sudo
any more.
After research, I restored the /etc/group
and /etc/gshadow
files from my backup. All groups for my user got successfully restored and now look like this:
[tobias@asterix ~]$ id tobias
uid=1000(tobias) gid=1001(tobias) groups=1001(tobias),0(root),995(audio),991(lp),1000(autologin)
Now I did re-login, but still the same error message:
[tobias@asterix ~]$ sudo ls
[sudo] password for tobias:
tobias is not in the sudoers file. This incident will be reported.
I checked the /ect/sudoers
, which on the first hand didn't get changed at all in the past, and it already does contain the following line:
root ALL=(ALL) ALL
If I am not mistaken, as my user is already part of the root
group, everything should actually be fine.
Maybe somebody can give me a hint of how to completely restore the setup of my system to original behavior?
/etc
-directory? This seems a typical backup-and-restore use case... :-#