TQuid has asked for the wisdom of the Perl Monks concerning the following question:

I am tasked with an evil task. Having designed, with perl's help, a fairly nice system that authenticates securely over the web using NIS to submit password changes to a db, which are then harvested (using a python script, actually) and plugged directly into the appropriate passwd files, I now have to "make it so" for NT, as well.

NT of course has convenient things you can pay for to go the wrong direction. I want NIS to be the canonical auth. source. Are there any modules that can help with this? How hard is it to manipulate NT passwords, and can I do it without putting them into my db in cleartext? Does anyone have a cyanide pill they could send me?

As always, any help much appreciated.

--TQuid

Replies are listed 'Best First'.
Re: Unix - NT passwd synching
by enoch (Chaplain) on Mar 07, 2001 at 01:20 UTC
    There are two easy ways to do this. Method number one is a batch file.
    # assume $rs is recordset of usernames and passwords open(BAT,">nt.bat"); while(!$rs->EOF) { print BAT "net user " . $rs->Fields("username")->value . " " . $rs +->Fields("password")->value . "\n"; } close(BAT); system("nt.bat");
    Or, you can use Roth's Win32::AdminMisc module. In that case:
    # assume $rs is recordset of usernames and passwords while(!$rs->EOF) { Win32::AdminMisc::SetPassword('DomainServer', $rs->Fields("usernam +e")->value,$rs->Fields("password")->value); }
    Not putting them into the DB via cleartext would be a bit harder. How are they getting into the DB? If it is over a web-page, use SSL to put them in the DB. However, going from the DB to the PDC is a bit more problematic. It can be done, but I would not want to do it. I would take the cynide pill at that point.

    Jeremy