Running client-connect script as another user?

How to customize and extend your OpenVPN installation.

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

Post Reply
MatejKovacic
OpenVPN User
Posts: 44
Joined: Wed Jun 19, 2013 9:43 am

Running client-connect script as another user?

Post by MatejKovacic » Fri Nov 16, 2018 2:15 pm

I try to run a script when user is connected. In OpenVPN server configuration I have:

Code: Select all

script-security 2
client-connect /etc/openvpn/notify.sh
client-disconnect /etc/openvpn/notify.sh
The problem is, that this script is running as user nobody, but I would run it as some other user. For instance, I have Signal-CLI application installed in my home directory. I tried to run it like this (content of /etc/openvpn/notify.sh), but this is not really working:

Code: Select all

sudo -u matej /home/matej/signal-cli/bin/signal-cli -u +3**** send -m "USER CONNECTED" +3***
Any idea how to solve this?

Post Reply