client-connect and client-disconnect

Scripts which allow the use of special authentication methods (LDAP, AD, MySQL/PostgreSQL, etc).

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

Post Reply
panji
OpenVpn Newbie
Posts: 1
Joined: Wed Mar 21, 2012 2:53 am

client-connect and client-disconnect

Post by panji » Wed Mar 21, 2012 3:04 am

Hi all, any idea how to configure client-connect and client-disconnect on the server side for OpenVPN AS?

TIA
panji

BrnVrn
OpenVpn Newbie
Posts: 9
Joined: Wed Oct 10, 2012 12:44 pm

Re: client-connect and client-disconnect

Post by BrnVrn » Wed Oct 10, 2012 1:19 pm

Hi,

There is a text area in "Advanced VPN Settings" / "Additional OpenVPN Config Directives (Advanced)" / "Server Config Directives"

There, I typed:

Code: Select all

script-security 2
client-connect "/etc/openvpn/client-connect.sh"
The script has permission: 755.
it is as simple as:

Code: Select all

#!/bin/bash
exit 0
I still get this message in the /var/log/openvpnas.log :
client-connect command failed: could not execute external program
I don't understand what is wrong.

Bruno

User avatar
xauen
Forum Team
Posts: 80
Joined: Tue May 10, 2011 7:57 pm
Location: Manila, Philippines
Contact:

Re: client-connect and client-disconnect

Post by xauen » Sun Oct 14, 2012 7:39 pm

Code: Select all

client-connect command failed: could not execute external program
Means there is really nothing to execute.

Try:

Code: Select all

#!/bin/bash
echo "this is only a test" >> /var/log/messages.log
and you should see some result

Also make it executable:

Code: Select all

chmod +x /etc/openvpn/client-connect.sh
"Never be bullied into silence. Never allow yourself to be made a victim. Accept no ones definition of you"
-IDK

BrnVrn
OpenVpn Newbie
Posts: 9
Joined: Wed Oct 10, 2012 12:44 pm

Re: client-connect and client-disconnect

Post by BrnVrn » Mon Oct 15, 2012 7:28 am

Thanks for your response.

The script has execute permission.
I also tried with echo "..." , but it doesn't change anything. (I saw ".. exit 0 .." advised on this forum to avoid any side effect.

I guess there are some chroot or special user involved.

In the meantime, I started from scratch with a CentOS and OpenVPN package.

It is sad as Access Server, looked quite useful at first.

Regards
Bruno

User avatar
xauen
Forum Team
Posts: 80
Joined: Tue May 10, 2011 7:57 pm
Location: Manila, Philippines
Contact:

Re: client-connect and client-disconnect

Post by xauen » Mon Oct 15, 2012 8:19 am

Can you post your server configs, probably you are using a "group nogroup" & "user nobody" in the configs. try removing that if you have it and check.
"Never be bullied into silence. Never allow yourself to be made a victim. Accept no ones definition of you"
-IDK

BrnVrn
OpenVpn Newbie
Posts: 9
Joined: Wed Oct 10, 2012 12:44 pm

Re: client-connect and client-disconnect

Post by BrnVrn » Mon Oct 15, 2012 8:32 am

I was using the OpenVPN Access Server appliance.

Do you want a dump of the config.db ? As explained in http://openvpn.net/index.php/access-ser ... erver.html

The Access Server run as openvpn_as:openvpn_as . I already tried to chown the script to this user without success.

Regards
Bruno

User avatar
xauen
Forum Team
Posts: 80
Joined: Tue May 10, 2011 7:57 pm
Location: Manila, Philippines
Contact:

Re: client-connect and client-disconnect

Post by xauen » Mon Oct 15, 2012 9:44 am

Seems better, lets see the logs
"Never be bullied into silence. Never allow yourself to be made a victim. Accept no ones definition of you"
-IDK

Post Reply