Page 1 of 1

client-connect not executing on server

Posted: Wed Nov 08, 2023 8:54 am
by blink
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.

Re: client-connect not executing on server

Posted: Thu Nov 09, 2023 6:02 pm
by openvpn_inc
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