Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Open VPN as a different user #43

Open
partisansb opened this issue Mar 1, 2023 · 1 comment
Open

Run Open VPN as a different user #43

partisansb opened this issue Mar 1, 2023 · 1 comment

Comments

@partisansb
Copy link

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

@Dragon2fly
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants