0

I have changed the default group of a user using chgrp command. After that I'm getting the error message" 'Username' is not in the sudoers file. This incident will be reported" for basic commands like sudo yum install update.

Any idea. Much appreciated.

1 Answer 1

0

We would need to see the sudoers file, but it is possible that this user was part of a group, and group had sudoers rights. Now it's no longer part of correct group, so doesn't get sudo permissions.

Example from sudoers file:

root    ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL

Now, if your user myuser was part of admin group, and now it's changed to someother group, it won't match any of the two lines.. it is not root and it is not in admin.

If you have another root/admin user or someone else has it, need to use it to add you either to correct group or your username explicitly to sudoers file.

Please check that first!

2
  • Thank you very much @LuxZg So we should add the user back to admin group to get the sudo access?
    – user497091
    Nov 11, 2020 at 23:56
  • Indeed, if user was in such a group this is most likely the reason.
    – LuxZg
    Nov 13, 2020 at 0:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .