DEV Community

Cover image for Start Windows service as non-admin
Julian
Julian

Posted on

2

Start Windows service as non-admin

setting permissions for windows services is really awful.

just want to allow a nonadmin to start and stop my php worker:

sc sdshow php5-cgi-worker01
D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;RPWPDT;;;S-1-5-21-<snip>-<snip>-<snip>-1000)
Enter fullscreen mode Exit fullscreen mode

permissions can be set with sc sdset ...

the easier way is to use SubInACL as admin:

subinacl.exe /service php5-cgi-worker01 /grant=username=PTO
Enter fullscreen mode Exit fullscreen mode

(P = pause, T = start, O = stop)

then you can start the service with your user:

sc start php5-cgi-worker01
Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs