What I want to do seems simple: A perl script running under Linux gets a username and password as input. Then it queries a Windows NT domain controller to see if the username and password are valid.
I found the Authen::Smb module, but it doesn't seem to be working, and the fact that it hasn't been updated since 1999 is disturbing.
Here's the code:
#!/usr/bin/perl -w use strict; use Authen::Smb; my $authResult = Authen::Smb::authen('username','passwd', '//PDC', '//BDC', 'NT_DOMAIN'); if ( $authResult == 0 ) { print "User successfully authenticated.\n"; } else { print "User not authenticated with error level $authResult\n"; }
This invariably returns "User not authenticated with error level 1." I've varied the way I specify the BDC and PDC (without slashes, as internet hostnames instead of NT names, and as IP addresses), and that doesn't change anything.
No failed queries show up in the logs of the domain controllers, so it seems like the queries aren't getting there at all.
Anyone know a better way? (My first suggestion to the boss, which was to make the NT guy figure out how to do this against the Linux machine, was met with chilly silence.)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |