Using Centos 7 AWS instance. i got the below Problem in all the instances


**[oms.deployer.acc@********* ~]$ service httpd restart

Redirecting to /bin/systemctl restart httpd.service

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===

Authentication is required to manage system services or units.

Multiple identities can be used for authentication:

Cloud User (ec2-user)


Choose identity to authenticate as (1-2):**


I am trying from oms.deployer.acc which is a static user and also have wheel access

I need to restart the httpd service with normal user


I believe the easiest way that will not suggest inventing a bycicle is going to be sudo. You still can provide user with limited number of commands, namely the systemctl restart httpd by using visudo

# visudo

add line like this:

nonprivuser ALL=(ALL) NOPASSWD: /bin/systemctl restart httpd

save file and test it:

# su - nonprivuser
$ sudo /bin/systemctl restart httpd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.