Reputation: 73
I am attempting to write a python script for linux to start openvpn and have been running into a problem getting openvpn to start using subprocess.
I am using the following to start openvpn:
openvpn_cmd = ['sudo', 'openvpn', '--config', 'client.cfg', '--auth-user-pass', 'hmaauth.conf']
prog = subprocess.Popen(openvpn_cmd)
But I get the following error back from OpenVPN:
Options error: --nobind doesn't make sense unless used with --remote
The config file is downloaded directly from the VPN service website prior to running the subprocess command, so I can't (and shouldn't have to) change anything in the configuration.
I've heard this can happen if you don't run with root privileges, but I'm already doing that...
Does anyone have any suggestions as to why I am getting this error?
I have a working shell script that starts openvpn using the following:
sudo openvpn --config client.cfg --auth-user-pass hmaauth.conf
Which should be exactly what I have in my python script.
Thanks in advance for your advice.
Upvotes: 3
Views: 7499
Reputation: 73
Ok, the problem here is that I'm dumb. I was downloading a config file that didn't have the remote server for the VPN specified, now I understand the 'no remote' error.
Now that I have that cleared up we're good to go.
Upvotes: 3