Create user authentication Openvpn Win Server

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

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

Post Reply
tymy19
OpenVpn Newbie
Posts: 1
Joined: Mon Feb 13, 2012 9:02 pm

Create user authentication Openvpn Win Server

Post by tymy19 » Mon Feb 13, 2012 9:11 pm

Hello,

i'm trying to make an user & password authentication on my openvpn server installed on my PC running windows 7.

i know i have to use a verification script but i don't know how to write it.

here is my server.conf

Code: Select all

## server.ovpn ##
port 80
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"

push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
comp-lzo
max-clients 4
persist-key
persist-tun
status openvpn-status.log
verb 3
auth-user-pass-verify auth-pam.pl via-file
script-security 3
tmp-dir C:\\tmpvpn
client-cert-not-required
username-as-common-name
i try to use the sample script which is in the linux version of openvpn but when a client connect to the server i got this error


Mon Feb 13 22:08:24 2012 10.211.55.2:54803 openvpn_execve: CreateProcess auth-pam.pl failed: %1 n’est pas une application Win32 valide. (errno=193)
Mon Feb 13 22:08:24 2012 10.211.55.2:54803 TLS Auth Error: user-pass-verify script failed to execute: auth-pam.pl
Mon Feb 13 22:08:24 2012 10.211.55.2:54803 TLS Auth Error: Auth Username/Password verification failed for peer
Mon Feb 13 22:08:24 2012 10.211.55.2:54803 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA
Mon Feb 13 22:08:24 2012 10.211.55.2:54803 [] Peer Connection Initiated with 10.211.55.2:54803
Mon Feb 13 22:08:26 2012 10.211.55.2:54803 PUSH: Received control message: 'PUSH_REQUEST'
Mon Feb 13 22:08:26 2012 10.211.55.2:54803 Delayed exit in 5 seconds
Mon Feb 13 22:08:26 2012 10.211.55.2:54803 SENT CONTROL [UNDEF]: 'AUTH_FAILED' (status=1)
Mon Feb 13 22:08:26 2012 10.211.55.2:54803 Connection reset, restarting [0]

i think the script work just on linux but i search on google during one week and i find nothing about ovpn windows script :( .

My question is how to make a simple script which verify the identity of my client by looking there username & password and compare them to a list of user/password allowed to connect to my server.

Thank you & sorry for my english :roll:

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Create user authentication Openvpn Win Server

Post by janjust » Thu Feb 16, 2012 9:10 am

A perl script is not considered a valid executable by Windows:
openvpn_execve: CreateProcess auth-pam.pl failed: %1 n’est pas une application Win32 valide. (errno=193)
try adding

Code: Select all

script-security 3 system
and make sure that your auth-pam.pl script can be run on the Windows command prompt command line.

Post Reply