[ale] scripting passwd change
Eric Z. Ayers
eric.ayers at mindspring.com
Tue Aug 22 21:10:50 EDT 2000
The version of passwd that comes with Red hat 6.2 has a little feature
called '--stdin' that can help you script a password change.
--stdin
This option is used to indicate that passwd should
read the new password from standard input, which
can be a pipe.
$ rpm -q passwd
passwd-0.64.1-1
-Eric.
Danny Cox writes:
> Ben,
>
> On Tue, 22 Aug 2000, Ben Phillips wrote:
>
> > Say I want to change my own password from a script. Is there any way to
> > make /usr/bin/passwd cooperate with this? I can make a file like:
> >
> > oldone
> > newone
> > newone
> >
> > ...and if I run 'passwd < myfile' it somehow knows I'm doing this and
> > rebels ("error changing password"). How do I bend it to my will?
>
> Yep. It opens "/dev/tty", which is a magic file that actually
> opens your "controlling terminal". In short, you can't do it with
> passwd, at least directly. In the back of my mind (there's those cob
> webs again!), it seems like perl might be able to do this.
>
> You could also grab the source to 'passwd' and muck with
> that....
>
> Danny
>
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list