* Help with passwd
@ 1995-09-29 4:00 Matt Pound
1995-09-29 4:00 ` Harald Fuchs
0 siblings, 1 reply; 3+ messages in thread
From: Matt Pound @ 1995-09-29 4:00 UTC (permalink / raw)
Hi,
I'm looking for a version of the passwd command or other method that would
allow us to enter passwords as command line parameters instead of being
prompted
for them eg
$ passwd <user> <password>
The reason we need this is we are trying to automate our user activation.
Thanks
--
*********************************************************************
* Matt Pound (Systems Support Analyst) *
* ISO Technical Support *
* University Of Portsmouth *
* PO1 2EG *
* England *
* *
* tel: +44 (0)1705 843624 *
* email: poundm@cv.port.ac.uk *
*********************************************************************
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with passwd
1995-09-29 4:00 Help with passwd Matt Pound
@ 1995-09-29 4:00 ` Harald Fuchs
1995-10-02 4:00 ` PAUL D. CHAPIN
0 siblings, 1 reply; 3+ messages in thread
From: Harald Fuchs @ 1995-09-29 4:00 UTC (permalink / raw)
Matt Pound <poundm@cv.port.ac.uk> writes:
> Hi,
> I'm looking for a version of the passwd command or other method that would
> allow us to enter passwords as command line parameters instead of being
> prompted
> for them eg
> $ passwd <user> <password>
If you're absolutely sure you want to do something dangerous like that:
ask archie for "expect".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with passwd
1995-09-29 4:00 ` Harald Fuchs
@ 1995-10-02 4:00 ` PAUL D. CHAPIN
0 siblings, 0 replies; 3+ messages in thread
From: PAUL D. CHAPIN @ 1995-10-02 4:00 UTC (permalink / raw)
Harald Fuchs (hf@colibri.de) wrote:
: Matt Pound <poundm@cv.port.ac.uk> writes:
: > Hi,
: > I'm looking for a version of the passwd command or other method that would
: > allow us to enter passwords as command line parameters instead of being
: > prompted
: > for them eg
: > $ passwd <user> <password>
: If you're absolutely sure you want to do something dangerous like that:
: ask archie for "expect".
One problem is getting the password to the expect script without it
being visible to anybody who does a ps command with the proper
options.
The script itself is fairly simple,
#!/usr/local/bin/expect -f
# wrapper to make passwd(1) be non-interactive
set password eeefff
set username juser3
spawn passwd $username
expect "quit):"
send "p\r"
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eof
This turns the problem of getting the password/username to how to edit
the script each time. The quick and dirty solution to this is to
create a file with the edit commands. The file name is visible with
ps, but not the commands and, in particular, not the password itself.
Now I have to update the edit commands each time. From the script
that drives this mess I have
# Set password on new account
# This is ugly but I can't find another way to get variables to
# the expect routine without making the password visible to ps
echo "5s/set password .*/set password $PASSWORD/" > $BASEDIR/sedscript
echo "6s/set username .*/set username $USERNAME/" >> $BASEDIR/sedscript
sed -f $BASEDIR/sedscript $BASEDIR/passwdscript > $BASEDIR/script.tmp
cp $BASEDIR/script.tmp $BASEDIR/passwdscript
/usr/local/bin/expect -f $BASEDIR/passwdscript > /dev/null
If somebody can come up with a less klutzy way of doing this I would
like to know about it.
Why do I do this, and why am I concerned that somebody may look as the
ps listing when this is going on? At the beginning of each academic
year I have to create something like 400 accounts. I don't want to
have to run passwd 400 times. The entire process takes so long that,
while the chance of any particular account being compromised is small,
the change that one or more will is fairly high. I know because I
didn't think of this the first year we ran the script and we had a
problem with people noticing the passwords - fortunately responsible
individuals who immediately warned me. The only other alternative,
and what I did the first year, is kick off all the users until the new
accounts are created, something that makes my users very cranky.
--
Paul Chapin
Unix Systems Manager
Amherst College
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1995-10-02 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-29 4:00 Help with passwd Matt Pound
1995-09-29 4:00 ` Harald Fuchs
1995-10-02 4:00 ` PAUL D. CHAPIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox