[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] howto set up openvpn with user & pass authentication


  • Subject: Re: [Openvpn-users] howto set up openvpn with user & pass authentication
  • From: "Brad Bendily" <bendily@xxxxxxxxx>
  • Date: Sun, 23 Sep 2007 18:04:04 -0500

On 9/23/07, Gregory Machin <gregory.machin@xxxxxxxxx> wrote:
> Hi
> Any idea where i can find a howto on setting up username and password
> authentication for client connection .. I want this for road worriors
> ... All i have found is a couple of explanation, but no complete
> working howto.
>
> Greg

Here is an example perl script you can use, using the instructions of
the previous poster:
#!/usr/bin/perl

use Net::LDAP;

$USER=$ENV{'username'};
$PASS=$ENV{'password'};


$ldap = Net::LDAP->new( 'ldap://172.24.254.1' ) or die "$@";
#$mesg = $ldap->bind ;    # an anonymous bind
$mesg = $ldap->bind( "$USER\@domain.com",
 password => "$PASS"
#$mesg = $ldap->bind( "CN=$USER,CN=Users,DC=domain,DC=com",
# password => "$PASS"
);


if ($mesg->code) {
  die $mesg->error;
exit 1;
} else {
#  print "Auth OK\n";
  exit 0;
  }
______________________
OpenVPN mailing lists
https://lists.sourceforge.net/lists/listinfo/openvpn-users