[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] scripting passwd change
- Subject: [ale] scripting passwd change
- From: danny at compgen.com (Danny Cox)
- Date: Tue, 22 Aug 2000 15:17:13 -0400 (EDT)
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.