vpngate-with-proxy
vpngate-with-proxy copied to clipboard
Run Open VPN as a different user
Hi Dragon2fly,
Me again, the problem I'm facing now is the script needs to be run as qvpn user to get through the dns on the system... I tried adding
command = ['sg qvpn -c openvpn', '--config', ovpn]
but it failed.
Where can I preappend sg qvpn -c to the openvpn command? Thanks
Hi @partisansb,
You could run the whole thing as a different user instead of just only the openvpn
process something similar to the command below. That is much easier in my opinion.
sudo sg qvpn -c "python vpnproxy_cli.py $arg"
As for the command, I think it should be
command = ['sg', 'qvpn', '-c', openvpn', '--config', ovpn]
But since you are chaining 2 commands together, that may not work.
You may even need to pass the shell=True
to the Popen
's parameter which is not security recommended.
So, first, you should try to run the whole thing as a different user first.