How to prevent systemctl command from asking for the root password

Solution Verified - Updated -

Issue

  • When executing an administrative command with systemctl as a regular user (e.g. systemctl restart <servicename>), the password for root user is requested:

    $ systemctl start rsyslog
    ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
    Authentication is required to manage system services or units.
    Authenticating as: root
    Enter login password: ****
    ==== AUTHENTICATION COMPLETE ===
    
  • Why does this happen and how to disable this completely?

Environment

  • Red Hat Enterprise Linux 7 and later
    • polkit
    • systemd

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