0

Yeah basically the title, I want to do that things from a app that can run Linux scripts per SSH. I only want to run these three and not ALL from systemctl with my basic user.

So thanks.

2 Answers 2

0

Try to use the --user switch. From systemctl(1)

--user

Talk to the service manager of the calling user, rather than the 

service manager of the system.

You may follow the instruction of this post.

0

Create a Cmnd_Alias in /etc/sudoers like:

Cmnd_Alias APACHEADMIN = /usr/bin/systemctl start apache2, /usr/bin/systemctl restart apache2, /usr/bin/systemctl stop apache2

Then add a line for the user privilege:

jsmith  ALL = NOPASSWD: APACHEADMIN
1
  • Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this. Apr 25, 2019 at 17:19

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.