openvpn_gui.exe connect without any prompt

How to customize and extend your OpenVPN installation.
Post Reply
Coopercentral
OpenVpn Newbie
Posts: 8
Joined: Sat Nov 30, 2013 4:14 am

openvpn_gui.exe connect without any prompt

Post by Coopercentral » Wed Dec 13, 2017 1:28 pm

Hello,

I am currently running OpenVPN 2.4.4 on PfSense, acting as a "remote access" server. I am utilizing my setup with both LDAP credentials and user certs. I downloaded the OpenVPN gui from PfSense, which incorporates my client config, along with certificates. My goal is to be able to pass a command that will connect my VPN, without any prompts. I have ticked the "Save Password", which apparently stores and encrypts it in the registry. I have used this command:

Code: Select all

openvpn_gui.exe --connect myconfig.ovpn
And even though my password is saved, it still prompts the username/password dialogue box. Is there any parameter or setting where the entire process can be silent, since it already knows about the password? I know there is the "auth-user-pass" feature, but that requires a plaintext file. If that is absolutely my only option, I will go with that. Maybe if no other option with the regular OpenVPN gui client, maybe there is another client out there capable of this.

I appreciate any insight to this!

Ken

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 7164
Joined: Fri Jun 03, 2016 1:17 pm

Re: openvpn_gui.exe connect without any prompt

Post by TinCanTech » Wed Dec 13, 2017 4:56 pm

I don't know if this will work if you have to have a password but the GUI supports --silent-connection

See: openvpn-gui.exe --help

Coopercentral
OpenVpn Newbie
Posts: 8
Joined: Sat Nov 30, 2013 4:14 am

Re: openvpn_gui.exe connect without any prompt

Post by Coopercentral » Wed Dec 13, 2017 7:55 pm

Hello, thank you for your reply! I did issue the "--help" parameter before posting here and tried most of those options, and they still resulted in the username/password dialogue box, and both were already filled in. It just required the "OK" from me.

Coopercentral
OpenVpn Newbie
Posts: 8
Joined: Sat Nov 30, 2013 4:14 am

Re: openvpn_gui.exe connect without any prompt

Post by Coopercentral » Thu Dec 14, 2017 7:00 am

I did some further Google'ing and found a solution. Apparently there was a request for this on the "github" site for the "openvpn-gui" page. They have modified the "openvpn.c" file. So, per their instructions I made their changes and compiled the EXE file using Cygwin on Windows. Now, because I tick the "save password", it will no longer prompt for username/password, as long as the "--silent_connection" parameter is also passed.

https://github.com/OpenVPN/openvpn-gui/pull/186

Post Reply