A couple of months back I was installed some communication software that made a VPN connection to the main server. It used OpenVPN to establish the connection and worked fine as long as your were an administrator on the PC. As I researched it further it installed a service and required that service to run on demand when the user launch the program. Since your standard limited user does not have privileges to start and stop services the application would fail to connect to the server.
So now the question becomes, how do you add permissions to a service?
Microsoft has an answer with a little known command line application called subinacl. This application allows you to view and edit security information for files, registry keys, and services. This can be handy if you are writing a script to change permissions on registry keys or files but the real power lies within the ability to edit the security information on services.
The syntax for subinacl: SUBINACL /SERVICE \\MachineName\ServiceName /GRANT=[DomainName\]UserName[=Access]
The Access parameter is broken down like this:
F : Full Control
R : Generic Read
W : Generic Write
X : Generic eXecute
L : Read controL
Q : Query Service Configuration
S : Query Service Status
E : Enumerate Dependent Services
C : Service Change Configuration
T : Start Service
O : Stop Service
P : Pause/Continue Service
I : Interrogate Service
U : Service User-Defined Control Commands
For my example I just needed to allow the Domain Users group access to run the OpenVPN service.
subinacl /service OpenVPN /GRANT=DOMAIN\Domain Users=TO
You may need to execute this from the folder where subinacl.exe is located. Also if it is running the command on a local system you can just type the name of the service and not the UNC path to the service.
Download subinacl.exe from Microsoft
For more information about this command please visit: http://support.microsoft.com/kb/288129
Hello,
I’m having trouble adding multiple permissions on my service.
it always seems that the last permissions overwrites everything else.
Do you have any ideea what i could be doing wrong?
perfect, thanks!
I’ve always wondered about that. Good article! Thx
Great jobs that Mr. Wayne do for us. Thanks
I have installed this tool but when I execute it the command in cmd.exe, it says subinacl is not recognized as a command, program, executable, etc.