[comp.unix.questions] Piping input into passwd

00499@vax1.acs.udel.edu (WEAVERLING) (09/19/89)

A few weeks ago, I asked the net how I could pipe input into passwd. I
needed to do this as a step in generating several hundred user accounts
each quarter (I work at a college). 

I got several responses (thanks to all), and here is a summary.      

1) Rob Barrell (rbarrell@ls.com) informed me that some vendors don't ship
   crypt and makekey cause of export restrictions. I called Prime and they
   shipped the "binary encryption files" to me. However, it still lacked
   makekey.

2) Writing a makekey is simple enough, however, before even worrying about
   it, Diomidis Spinellis from Munich sent me his own source (original
   code) for makekey.

3) Another soul from Toronto (sorry, misplaced your name) sent me an entire
   program to generate accounts, home dirs, etc. 
 
4) Various others sent similar info and offers for help, which I am 
   grateful for.
 
In summary, passwd accepts input from /dev/tty which can't be redirected.
Solutions all involved writing programs or scripts to manually insert the
password into the proper field in /etc/passwd. This password is encrypted.
One can generate an encrypted program using /usr/lib/makekey which 
accepts an eight char password and a two char "salt." (if password is 
less than 8 chars, pad with nulls, or user has to type the trailing 
spaces when entering login password.) Use the output of makekey and paste
it into passwd.
 
And the saga continues. I just got Sys V 3.1 which introduces the shadow
file, and my darn DOS file server software (PC Interface by Locus) still
looks in /etc/passwd for the password, so no one can log into PC Interface,
"the fix is in the mail" Prime says... At least my passwd generating 
problems are solved. THANK YOU NET :-)
 
 
Ken Weaverling   +1 302 573 5460       | "OS/2 is like AIDS
Delaware Technical & Community College |  They say millions have it
00499@vax1.acs.udel.edu                |  You don't know anyone that's got it
weave@pyr1.acs.udel.edu                |  And you pray to God you don't get it"