Page 1 of 1

Running OpenVPN as an unprivileged user (automation script)

Posted: Sat Jan 21, 2017 8:51 pm
by wknapik
Hi everyone. I wrote a script to automate the steps necessary to run an OpenVPN client without root privileges - https://github.com/wknapik/openvpn-unroot - I'm looking for feedback. Dazo at #openvpn already suggested using pkexec instead of sudo - thanks for that! - it's the first improvement I'm going to make. If you have further comments, please respond here, or open an issue on github. Cheers.

Re: Running OpenVPN as an unprivileged user (automation script)

Posted: Mon Feb 10, 2020 5:46 pm
by ablrbls072
hello. I am trying to run your script on NixOS but I keep getting errors:

INFO: Adding group openvpn
INFO: Adding user openvpn
INFO: Generating sudoers file /etc/sudoers
INFO: Generating iproute file /usr/local/sbin/unpriv-ip-unrooted
INFO: Adding device tun00-unrooted
./openvpn-unroot: line 397: `testing && echo "${comm[@]}" || "${comm[@]}" >/dev/null' returned 1
ERROR: Reverting all changes
./openvpn-unroot: line 499: `local ret; ret=("$("$@")"); readonly ret' returned 1
ERROR: Reverting all changes

pls advise. :(