* change user's password in shell
@ 2000-03-26 5:00 keel
2000-03-27 5:00 ` Paul A Sand
0 siblings, 1 reply; 2+ messages in thread
From: keel @ 2000-03-26 5:00 UTC (permalink / raw)
It there any way to change user's password in a shell
program?
It must base the " passwd " command,for i am use digital
unix and have no other command to change user's password
Thanks
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: change user's password in shell
2000-03-26 5:00 change user's password in shell keel
@ 2000-03-27 5:00 ` Paul A Sand
0 siblings, 0 replies; 2+ messages in thread
From: Paul A Sand @ 2000-03-27 5:00 UTC (permalink / raw)
keel <coolkeelNOcoSPAM@sina.com.invalid> writes:
>It there any way to change user's password in a shell
>program?
>It must base the " passwd " command,for i am use digital
>unix and have no other command to change user's password
If you want to write a shell wrapper around `passwd' that users
can run, then I think most people might point you to the `expect'
program, which deals properly with calling inherently interactive
programs like passwd from a script. You can find out about expect
at http://expect.nist.gov/
If you (as root) want to change people's passwords, then calling
/usr/sbin/vipw from your shell script is another possibility. In your
script, set the EDITOR environment variable to /bin/ed, open a pipe to
/usr/sbin/vipw, and send down the appropriate ed commands to replace
the user's password field with the encrypted password of your choice.
You of course need to be really careful with your ed commands to
avoid corrupting the file.
--
-- Paul A. Sand | My list of what does not work is only
-- University of New Hampshire | 1543662 bytes right now. It is not complete,
-- pas@unh.edu | but does provide a good start.
-- http://pubpages.unh.edu/~pas | (Mike Stump, in gnu.g++.bug)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-03-27 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-26 5:00 change user's password in shell keel
2000-03-27 5:00 ` Paul A Sand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox