vpngate-with-proxy icon indicating copy to clipboard operation
vpngate-with-proxy copied to clipboard

Run Open VPN as a different user

Open partisansb opened this issue 1 year ago • 1 comments

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

partisansb avatar Mar 01 '23 14:03 partisansb

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.

Dragon2fly avatar Mar 04 '23 04:03 Dragon2fly