From: Paul A Sand <pas@unh.edu>
Subject: Re: change user's password in shell
Date: 2000/03/27 [thread overview]
Message-ID: <8bn9lo$vmf$1@tabloid.unh.edu> (raw)
In-Reply-To: 0724ac5b.08a67ae9@usw-ex0108-062.remarq.com
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)
prev parent reply other threads:[~2000-03-27 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-26 5:00 change user's password in shell keel
2000-03-27 5:00 ` Paul A Sand [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox