I recently did a clean install of Linux (the latest version of Debian, version 9.1, 64-bit Cinnamon) and am unable to add myself to the "sudo" group.
When logged in as myself, this is the output of the groups
command:
daniel cdrom floppy audio dip video plugdev netdev bluetooth lpadmin scanner
When I use su
to become root and enter the command adduser daniel sudo
, the output is:
The user `daniel' is already a member of `sudo'.
Sure enough, if I use the command groups daniel
while still logged in as root (with su
), the output is:
daniel adm cdrom floppy sudo audio dip video plugdev netdev bluetooth lpadmin scanner
(Note that "sudo" is now in the list.)
I have logged out and logged back in several times, but I still am not in the "sudo" group when I run the groups
command. This means that when I attempt to run a sudo
command, I get the error:
daniel is not in the sudoers file. This incident will be reported.
Also, I have confirmed that the sudoers file contains an entry granting sudo privileges to the sudo group. When I run visudo
, these lines are present:
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
I know that I can use visudo
to manually add an entry that grants me sudo rights. I mainly want to know why I cannot add myself to the "sudo" group.
Sorry if this is a repeat question. I Googled for a while and couldn't find anyone else who could not add themselves to the sudo group.
groups
, and the output did include "sudo." – Daniel Charles Sep 02 '17 at 04:56loginctl
). – sebasth Sep 02 '17 at 04:58groups
command, and I can now use sudo. Thanks! If you want, if you add an answer below, I will mark it as answered. – Daniel Charles Sep 02 '17 at 05:07