User is in the sudo
group
/etc/sudoers
file does have an entry
%sudo ALL=(ALL:ALL) ALL
But they still get the message:
user not in sudoers file. This incident will be reported.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityIf you've just added the user to the sudo group, you need a fresh login into the OS. So you may log out and then log back again. Or you can use another tty to do the sudo task without logging in. (Try Ctrl+Alt+F1...F8.)
If you only guess the user is in the group, while in fact it is not, you need to run these two commands:
su root
And now as root:
adduser user_name sudo
And now relog or log into another tty.
sudo -l
should show you the commands you may and may not execute. You can add another -l for longer output, and specify a user with -u.
groups
command and see (show in the Question) if it contains “sudo”. Perhaps they logged in before being added to the group.