2

I tried exectuting a command.

me@intern:~$ sudo ls
[sudo] password for me: 
me is not in the sudoers file.  This incident will be reported.

But I am in the sudo group

me@intern:~$ groups
sudo

/ets/sudoers :

Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

root    ALL=(ALL:ALL) ALL

%admin ALL=(ALL) ALL

sudo    ALL=(ALL:ALL) ALL

john ALL = NOPASSWD: /usr/sbin/service apache2 reload
john ALL = NOPASSWD: /usr/sbin/service apache2 restart
john ALL = NOPASSWD: /usr/bin/vi /etc/php/7.0/apache2/php.ini
10

What your sudoers file is showing is that a user called sudo may use sudo. If you want to add the group called sudo, then do it as is done with the admin group, i.e. add a % in front of the group name:

%sudo    ALL=(ALL:ALL) ALL

(If the admin group is not in use by anyone on the system, I would remove its sudo permissions at the same time.)

Group names are prefixed with %, while usernames don't have a prefix.

Additionally, numerical UIDs and GIDs may be used with #:

#1000 ALL= ...

%#1000 ALL= ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.