Why is a user not being asked to enter a password for sudo even though configured to need one?

Solution Unverified - Updated -

Issue

  • The user exampleuser should be asked to enter a password when using the sudo command.
  • Permissions defined in the /etc/sudoers.d/1-exampleuser file as such:

    exampleuser ALL=ALL
    
  • Contrary to the setting in /etc/sudoers.d/1-exampleuser, the user exampleuser can execute commands with sudo without entering a password. For example:

    [exampleuser@examplelinux ~]$ sudo whoami
    root
    

Environment

  • Red Hat Enterprise Linux (RHEL)
    • 5
    • 6
    • 7
    • 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content