cancel
Showing results for 
Search instead for 
Did you mean: 
Codekaito
Cadet
Cadet
  • 35 Views

Sudo privilege issues for non-wheel groups

I'm encountering an issue with root privilege assignment to a non-wheel group in my Red Hat Enterprise Linux system. Specifically, I'm trying to grant passwordless sudo access to a custom group named 'adminteam', but users in this group are still prompted for a password.

I've attempted to configure this in two ways:

  1. Directly adding the rule to /etc/sudoers.
  2. Creating a separate configuration file /etc/sudoers.d/adminteam.

In both scenarios, the result is the same: individual user entries with NOPASSWD: ALL work as expected, but the group rule does not.

Here's a breakdown of the issue:

  • Expected Behavior: Users in the 'adminteam' group (or any non-wheel group) with NOPASSWD: ALL in /etc/sudoers or /etc/sudoers.d/adminteam should be able to execute sudo commands without a password prompt.
  • Actual Behavior: Users in the 'adminteam' group are still prompted for a password.
  • Working Scenario: Individual user entries with NOPASSWD: ALL function correctly.

Here's a simplified example of my configuration (both in /etc/sudoers and /etc/sudoers.d/adminteam):

# Example sudoers entry
%adminteam ALL=(ALL) NOPASSWD: ALL
myuser ALL=(ALL) NOPASSWD: ALL

In this example, myuser can execute sudo commands without a password, but users within the adminteam group still require a password.

I've verified that the users are indeed members of the 'adminteam' group.

My questions are:

  • Is there a known difference in how sudo handles non-wheel groups compared to the 'wheel' group, or individual users?
  • Are there specific considerations for using /etc/sudoers.d/ for group configurations?
  • Is there a potential conflict between rules in /etc/sudoers and /etc/sudoers.d/?
  • Is this the expected behavior?
  • Is this a bug?
1 Reply
Chetan_Tiwary_
Community Manager
Community Manager
  • 13 Views

@Codekaito you can try this :

1. Always use visudo

2. remove that group entry from the /etc/sudoers and enter it in /etc/sudoers.d/adminteam

3. uncomment the includedir /etc/sudoers.d in the /etc/sudoers  if any.

4. check visudo -c   for any errors in the config file.

now check if it works.

Join the discussion
You must log in to join this conversation.