I am trying to set OpenVPN with LDAP Authentication. It should ask me for username and password when I try to connect with:
openvpn --config client.ovpn
The username should be created in LDAP.
Here is my OpenVPN AS config:
LDAP Settings Primary server: 127.0.0.1
Bind DN: cn=admin,dc=vpn-ldap
Base DN for User Entries: DC=vpn-ldap
Username Attribute: uid
I am attaching LDAP structure as a screenshot and text input:
user.ldif
dn: cn=test,dc=vpn-ldap
cn: test
objectClass: organizationalRole
objectClass: simpleSecurityObject
#objectClass: person
objectClass: uidObject
uid: test
userPassword: ******
And this is the output which it gave me when I tried to connect with "test" user:
openvpn --config client.ovpn
Wed Oct 26 19:49:01 2016 OpenVPN 2.3.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Nov 12 2015
Wed Oct 26 19:49:01 2016 library versions: OpenSSL 1.0.1t 3 May 2016, LZO 2.08
Enter Auth Username: ****
Enter Auth Password: **********
Wed Oct 26 19:49:08 2016 Control Channel Authentication: tls-auth using INLINE static key file
Wed Oct 26 19:49:08 2016 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Oct 26 19:49:08 2016 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Oct 26 19:49:08 2016 Socket Buffers: R=[212992->200000] S=[212992->200000]
Wed Oct 26 19:49:08 2016 UDPv4 link local: [undef]
Wed Oct 26 19:49:08 2016 UDPv4 link remote: [AF_INET]178.22.65.94:1194
Wed Oct 26 19:49:08 2016 TLS: Initial packet from [AF_INET]178.22.65.94:1194, sid=80ab4413 57af5883
Wed Oct 26 19:49:08 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Wed Oct 26 19:49:08 2016 VERIFY OK: depth=1, CN=OpenVPN CA
Wed Oct 26 19:49:08 2016 VERIFY OK: nsCertType=SERVER
Wed Oct 26 19:49:08 2016 VERIFY OK: depth=0, CN=OpenVPN Server
Wed Oct 26 19:49:09 2016 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Oct 26 19:49:09 2016 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Oct 26 19:49:09 2016 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Oct 26 19:49:09 2016 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Oct 26 19:49:09 2016 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Wed Oct 26 19:49:09 2016 [OpenVPN Server] Peer Connection Initiated with [AF_INET]178.22.65.94:1194
Wed Oct 26 19:49:12 2016 SENT CONTROL [OpenVPN Server]: 'PUSH_REQUEST' (status=1)
Wed Oct 26 19:49:12 2016 AUTH: Received control message: AUTH_FAILED
Wed Oct 26 19:49:12 2016 SIGTERM[soft,auth-failure] received, process exiting