Windows – OpenVPN Run as Administrator Problems

openvpnwindows

I had posted about this a while ago but had a few new questions with some comments that I would really appreciate some input on.

I am using a custom OpenVPN install using 7zip. It installs the program and unzips the keys and configuration files to the correct location. This is being installed by an administrator and needs to work for non admin users. Before there was an issue about not pushing the routes correctly and I am going to get around that by adding the users to the Network Config group which will allow them to add routes but not a whole lot more power. Now I am getting the error "Error opening logfile for writing C:\Program Files\OpenVPN\log\client.log. You probably don't have administrator privileges, which are necessary to run OpenVPN." Is there anyway around this? OpenVPN still works even though this error occurs so is there anyway to just turn the error off (changing verb to 0 does not work) or recompile it to ignore this error? Is there anyway to change the logging location to event viewer or another directory such as C:\Users\%currentuser%\OpenVPN.log (when I try to do this with log or log-append option it throws another error and doesn't work so I would prefer event viewer so there wouldn't be any permission issues).

I really appreciate any input. We are getting closer on wanting to deploy on a wider scale and this is the last major obstacle.

Best Answer

Looking at my Win7 pro install, regular users do not have the right to write to files in c:\program files\openvpn (or any directory in Program Files for that matter) by default. Not sure of XP. You'll need to adjust the permissions either on the log file itself and/or the openvpn directory.

You could try using the cacls or icacls command in an install script to change the permissions of the file/directory.