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.
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Try to use the
--user switch. From
--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.
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