You are not logged in.

#1 2015-11-26 15:35:29

Canberk Sönmez
Member
Registered: 2015-11-14
Posts: 4

Allow any user to manage a specific service using systemctl

How can I allow any user to start or stop a service which needs root rights to be started or to be stopped using systemctl?

Offline

#2 2015-11-26 15:45:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Allow any user to manage a specific service using systemctl


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-12-02 22:35:35

jinal
Member
Registered: 2014-10-26
Posts: 19

Re: Allow any user to manage a specific service using systemctl

If you don't want all your users to get sudo access, perhaps you could also try https://wiki.archlinux.org/index.php/Polkit

I am not certain it would let you allow specific users to only enable a specific service, but it looks promising to me. Perhaps some sort of wrapper script.

Good luck.

Last edited by jinal (2015-12-03 09:46:05)

Offline

#4 2015-12-03 03:25:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Allow any user to manage a specific service using systemctl

jinal wrote:

If you don't want all your users to get sudo access...

What does this mean?  With sudo you configure which users should be allowed to run what commands.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-12-03 09:46:37

jinal
Member
Registered: 2014-10-26
Posts: 19

Re: Allow any user to manage a specific service using systemctl

Trilby, sorry, my mistake.

Offline

#6 2015-12-10 05:00:11

openrijal
Member
Registered: 2015-12-10
Posts: 2

Re: Allow any user to manage a specific service using systemctl

you can use "visudo" to add that user to run only a specific command and not require password. Something like this

user1 ANY=(ANY) service

Offline

#7 2015-12-10 13:35:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Allow any user to manage a specific service using systemctl

openrijal, that would still require a password.  The instructions on how to do it properly are in the wiki or man page.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB