Running OpenVPN as an unprivileged user (automation script)

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
wknapik
OpenVpn Newbie
Posts: 3
Joined: Sun Oct 09, 2016 4:21 pm

Running OpenVPN as an unprivileged user (automation script)

Post by wknapik » Sat Jan 21, 2017 8:51 pm

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.

ablrbls072
OpenVpn Newbie
Posts: 1
Joined: Mon Feb 10, 2020 5:42 pm

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

Post by ablrbls072 » Mon Feb 10, 2020 5:46 pm

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. :(

Post Reply