From: Dave Airlie (airlied at domain csn.ul.ie)
Date: Thu 04 Oct 2001 - 12:28:59 IST
You could use pam_smb to make the Linux password be taken from the Samba
server... I wrote a PAM module 4 or 5 yrs ago to do this for a lab in
UL...
http://www.csn.ul.ie/~airlied/pam_smb
It will allow you just to put * passwords in the NIS tables for all users
and use a central samba server to authenticate the users...
Dave. blowing his own trumpet :-)
On Thu, 4 Oct 2001, Cormac McClean wrote:
> Hi,
>
> I am in the process of RTFMs[0], but I was wondering if anyone had any
> pointers.
>
> We've set up a Linux server for students which uses NFS/NIS and Samba
> to give them access to their home directories from Linux and Windows NT.
> I'm writing a perl script to synchronise passwords for NIS and Samba, and
> I've run into a problem using Expect.
>
> Here's the subroutine. I'm passing in the username and new password.
>
> sub SetPasswd {
> my ($username, $passwd) = at domain _;
>
> my $pobj = Expect->spawn($passwdex, $username);
>
> die "Unable to spawn $passwdex:$!\n" unless (defined ($pobj));
>
> $pobj->log_stdout(0);
>
> $pobj->expect(10, "New password: ");
> sleep 1;
>
> print $pobj "$passwd\r"; ### <--- Problem here
> $pobj->expect(10, "Re-enter new password: ");
> print $pobj "$passwd\r"; ### <--- and here
>
> $result = (defined ($pobj->expect(10, "successfully changed")) ?
> "" : "password change failed");
>
> $pobj->soft_close();
>
> return $result;
> }
>
> It's taken from "Perl for System Administration" (O'Reilly). At the moment
> I'm testing with the yppasswd program (so $passwdex is /usr/bin/yppasswd).
> What's happening is that the spawn is occurring, but not working properly.
> For one thing, I'm getting error messages relating to the lines
> print $pobj "passwd\r";
> which are:
> print on closed filehandle Symbol::GEN0 at /usr/local/bin/sync_pass.pl line
> 64, <STDIN> chunk 4.
> which indicates that the spawn has not been successful (and yet $pobj is
> defined, otherwise the script would die at that point).
>
> Any suggestions? Or is there an alternative way to synchronise the NIS and
> Samba passwords? Perhaps by using configuring Samba to use the NIS passwords?
> Just thought of that....
>
> Thanks in advance,
> Cormac.
>
> [0] Manuals include "Uisng Samba", "Managing NFS and NIS", "Perl for System
> Administration", and various other O'Reilly books... I have a veritable
> shrine to O'Reilly Publishing in my office.
>
>
-- David Airlie, Software Engineer http://www.skynet.ie/~airlied / airlied at domain skynet.ie pam_smb / Linux DecStation / Linux VAX / ILUG person
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:12:31 GMT