Permission denied when running any SUDO commands despite ALL commands are permitted

Solution Verified - Updated -

Issue

Permission denied when running any SUDO commands despite ALL commands are permitted.

  • SUDO rule is in place to allow user to run ALL commands

    user1            ALL=(ALL)       NOPASSWD: ALL
    
  • However, the user is not able to run any permitted commands via SUDO, with Permission denied error

    $ sudo su -
    su: failed to execute /bin/bash: Permission denied
    
    $ sudo visudo
    visudo: unable to run /bin/vi: Permission denied
    visudo: /etc/sudoers.tmp unchanged
    

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
    • sudo

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