D
D
Dana2018-07-05 11:44:19
openvpn
Dana, 2018-07-05 11:44:19

How to remove AUTH_FAILED error when using client-connect?

There is a server and several OpenVPN clients on CentOS. Tunnels are created between the server and clients. Everything is working.
But there was a need to add a script that captures when the client connects and disconnects from the server.
To do this, I added to the end of the server configuration:

script-security 3
client-connect "/etc/openvpn/connect_control.sh 1"
client-disconnect "/etc/openvpn/connect_control.sh 2"

After that, the clients stopped connecting to the server.
In the logs:
Wed Jul  4 13:07:40 2018 [client1] Peer Connection Initiated with [AF_INET]192.168.***.***:1194
Wed Jul  4 13:07:41 2018 SENT CONTROL [client1]: 'PUSH_REQUEST' (status=1)
Wed Jul  4 13:07:41 2018 AUTH: Received control message: AUTH_FAILED
Wed Jul  4 13:07:41 2018 SIGTERM[soft,auth-failure] received, process exiting

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2018-07-05
@ky0

Try changing the quotes to single quotes. Well, why script-security 3? 2 is enough in this case.

D
Denis, 2018-07-05
@notwrite

connect_control.sh must have a return code of 0 for a client to connect. And the parameters in the script are not needed. All data is in environment variables.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question