[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: autopasswd



> 
> On Wed, 2 Jul 1997, Adam Kerasotes wrote:
> 
> > Hello I have a Redhat-4.2 system using Shadow Passwords.  I have a custom
> > program written to add users to the systesm.  This program calls the
> > autopasswd script which came w/ redhat to set the users password.  Problem
> > is that it doesn't seem to work.  I tried modifying the script slightly.  Is
> > there a fix for this? I would really like it if I didn't have to write any
> > new code into my adduser program.  Thanks in advance
> 
> Try editing /usr/bin/autopasswd and changing the line that reads:
> 
>    spawn passwd [lindex $argv 0]
> 
> to
> 
>    spawn /usr/bin/passwd [lindex $argv 0]
> 
> That should fix it.

Did not fix it, Problem is it seems to enter the Password once and then
usually dies.  I am running the updated Pwdb Package from Redhat.  The
password program seems to have had some changes between the offical release
and the update.  Here is the script I have been using

#!/usr/bin/expect -f
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd

set password [lindex $argv 1]
spawn /usr/bin/passwd [lindex $argv 0]
expect "password: "
send "$password\r"
expect "password: "
send "$password\r"
expect eof

If this script looks wrong please tell me, it is calling password but not
finishing properly
*******************************************************************************
			     Adam Kerasotes
		    Network Administrator Quincy University
		           E-mail:adam@quincy.edu
*******************************************************************************



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []