[ale] scripting passwd change

Danny Cox danny at compgen.com
Tue Aug 22 15:17:13 EDT 2000


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.





More information about the Ale mailing list