entering 2500 passwords : Part 2

From: Chris Myers <cmyers_at_kiski.net>
Date: Fri, 07 May 1999 09:12:31 -0400

in a previous email :
>Hi,
>I am in a bind here. i need to enter 2500 passwords.
>is there anyway to do this programmatically. we are doing it with passwd,
>but this is very tedious and we will never make the deadline. (i can get
the >passwds in a txt file username,passwd)
>du 4.0e is the version.
>any help would be greatly appreciated.
>Thanks
>Chris

i forgot (i was 3:00 am when i wrote the email) to mention that i am using
c2 security.

thanks for all the answers so far. most are suggesting expect. one even
wrote a c program (Thanks)

i have an expect script but error trapping is eluding me. anyone willing to
help? i would like to run this from a perl program and if there is an error
to log the error to a file with the reason.

i would of course post the script a perl script to here when done. i
appreciate any help and the help already received.

here is the script:

#!/usr/local/bin/expect

set user [lindex $argv 0]
set password [lindex $argv 1]
spawn /bin/sh
expect "#"
send "passwd $user\r"
expect "quit):"
send "p\r"
expect "New password:"
send "$password\r"
expect {
    "Re-enter new password:" { send "$password\r" }
    "same password." { send_user 1 }
    "characters long." exit
}
close


Thanks again

Chris
Received on Fri May 07 1999 - 13:15:49 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT