Automatically changing passwords in a script

Automatically changing passwords in a script

Post by A.J. Bleijenber » Mon, 20 Dec 1999 04:00:00



Hi there,

I have have the following problem:

I'm trying to add/change a username and password automaticly within a
shellscript triggered by the existence of a certain file which contains
the username and password.
The creation of a user isn't a problem. However the creation of password
still doesn't work so far. The passwd command keeps prompting for input.

Is there a way to automate password creation??

I hope someone can tell me how to do this!

Tom Bleijenberg.

 
 
 

Automatically changing passwords in a script

Post by Thomas L|fgre » Thu, 23 Dec 1999 04:00:00


    Tom> Hi there, I have have the following problem:

    Tom> I'm trying to add/change a username and password automaticly
    Tom> within a shellscript triggered by the existence of a certain
    Tom> file which contains the username and password.  The creation
    Tom> of a user isn't a problem. However the creation of password
    Tom> still doesn't work so far. The passwd command keeps prompting
    Tom> for input.

Right.  The password is not read from stdin, but from the terminal.

    Tom> Is there a way to automate password creation??

I believe 'expect' can do this.

Hth,
Tom
--
T. Lofgren - Wherever I lay my .emacs, that's my ${HOME}
These opinions are mine, not yours.  Get your own damn opinions.