Xref: utzoo comp.unix.ultrix:7434 comp.unix.admin:2063 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!hollie.rdg.dec.com!hollie.rdg.dec.com!jch From: jch@hollie.rdg.dec.com (John Haxby) Newsgroups: comp.unix.ultrix,comp.unix.admin Subject: Re: Question on changing passwords in batch... Message-ID: <1991May31.081705.702@hollie.rdg.dec.com> Date: 31 May 91 08:17:05 GMT References: <1991May23.192536.10000@menudo.uh.edu> Sender: news@hollie.rdg.dec.com (Mr News) Organization: Digital Equipment Corporation Lines: 22 You could use awk on the password file. Something like this: awk -F: ' /^first:/ { PASSWORD=$2; print $0 } /training_user/ { print $1 ":" PASSWORD ":" ... }' and you need to worry about printing the other entries in the password file as well. This way you change the first training user's password and run this little command to copy it into all the others. If you have a hashed password data base, you'll need to run /etc/mkpasswd by hand. You could get clever and run /etc/lockpw and /etc/unlockpw while you are changing the password file. If you have a distributed password file, you'll have to change the master copy and then persuade hesiod or yp (or whatever) to re-distribute the file. -- John Haxby, Definitively Wrong. Digital Reading, England <...!ukc!wessex!jch> ---------------------------------------------------------------- The opinions expressed herein are my own, not my employers.