client-connect not executing on server

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
blink
OpenVpn Newbie
Posts: 1
Joined: Wed Nov 08, 2023 8:48 am

client-connect not executing on server

Post by blink » Wed Nov 08, 2023 8:54 am

I have an access server operating on an Ubuntu server. I have added to my as.conf file the following line:

Code: Select all

client-connect /home/openvpnas/scripts/on_connect.sh
However, my on_connect.sh script is not executing when users connect. I have set the script to be executable, and I am able to run it manually without issue. I am supposing my problem is a permission, but I'm not certain. I have modified the permissions on the on_connect.sh many times and tried several different permission models but no change.

I am able to validate if the script runs as it is designed to write to /var/log/syslog. This was validated as when I ran the script manually syslog was indeed updated.

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1333
Joined: Tue Feb 16, 2021 10:41 am

Re: client-connect not executing on server

Post by openvpn_inc » Thu Nov 09, 2023 6:02 pm

Hello blink,

I am sorry to say that the Access Server does not support client-connect scripts. You may be able to achieve what you want using a post_auth script though.

It's just that as.conf does not contain OpenVPN directives and does not accept them. The as.conf file is for configuring certain basic things for Access Server operation. But even if you were to add server config directives, I seem to recall it would not accept the parameter client-connect, sorry.

Your best option is to look into post_auth script. This is a custom python script that you can provide and load into the Access Server to be executed after a user has successfully authenticated, and can do anything you'd like to do after that step.

Kind regards,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply