torstai 21. tammikuuta 2016

OpenVpn save Username and Password to a file.

So I have created ShellScript which opens VPN connection but everytime it asks my password and I wanted to automate this. So do the following:

Inside your vpn key folder should be file called config.opvn or something that ends with .ovpn. Open it up and look for auth-user-pass if your file doesn't contain this add it to the bottom. Right after it add one space and filename.txt like this:

auth-user-pass vpnpass.txt

Then inside the same folder where your .ovpn file is add new file called vpnpass.txt and insert your username and password separated with enter. Like this:


Save both files and now your VPN shouldn't ask password or username.