How to give access to start,stop and restart a service like apache to a user

hi dear friends
i wana give permission for start/stop/restart a service to a special user in centos 7.
i use visudo but it did not work. maybe i have problem in syntax of configurations.
i wrote below line for user “albert” :

albert ALL=NOPASSWD: /usr/bin/systemctl restart httpd.service

please help me. thank you guys.

1 Like

Hi Once look at below link

1 Like