Hello Tarik,
Tuesday, July 03, 2001, Tarik Jeait <[EMAIL PROTECTED]> wrote:
TJ> can somebody tell me how to change my unix passwd by a perl
TJ> script:
TJ> open(FILE,"|passwd"); --> doesn't work ;
TJ> must I open some pipe or What ?
on linux - man usermod
on freebsd - man pw
on ... - man
On Tue, 3 Jul 2001, Tarik Jeait wrote:
> can somebody tell me how to change my unix passwd by a perl script
> :
>
> open(FILE,"|passwd"); --> doesn't work ;
>
> must I open some pipe or What ?
You'll want to use the Expect module, which can be used to automate
interactive tasks like this.
The passwd program usually (if not always) expects a TTY - so you either
have to fake it out with something like Expect.pm (do a google search on
change password passwd Expect.pm perl) or use a stream of commands fed
into vipw (including the new password encrypted) to do the dirty work.
I would t
i am not certain if you are looking at actually using the 'passwd' command
to change your password, or just its functionality. one cgi script that
does this is brink.cgi which is freely available. at the very least,
you'll get one individuals take on how to do it and perhaps build upon it.
-char