N
N
Nikolay Baranenko2018-10-18 13:52:07
CentOS
Nikolay Baranenko, 2018-10-18 13:52:07

How to correctly add the ability to restart the service without additional password entry?

Hello.
HAProxy 1.8 was installed on the server.
Service is created by default

systemctl enable rh-haproxy18-haproxy && systemctl start rh-haproxy18-haproxy && systemctl status rh-haproxy18-haproxy

all this works from under root.
I would like to provide the ability to restart the service to another user USER1
in order to create the haproxy
file in /etc/sudoers.d
Cmnd_Alias HAPROXY = /usr/bin/systemctl stop rh-haproxy18-haproxy.service, /usr/bin/systemctl start rh-haproxy18-haproxy.service, /usr/bin/systemctl restart rh-haproxy18-haproxy.service

%haproxy ALL=HAPROXY

Added USER1 to the haproxy group,
then I execute
sudo systemctl restart rh-haproxy18-haproxy.service && systemctl status rh-haproxy18-haproxy.service

Everything is fine, BUT every time it asks for a password.
How to correctly add the ability to restart the service without additional password entry?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-10-18
@drno-reg

add NOPASSWD:ALL
PS I am writing from the phone, check the syntax in mana..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question