[comp.unix.xenix] Generating passwords automatically

markj@infmx.UUCP (Mark Jeske) (08/09/89)

Is it possible to automatically generating passwords and place the
encrypted form in the /etc/passwd file?  I need to create about 1200
random passwords.  I'm running xenix 2.3.2 on a ps/2 model 80.

Thanks for any help.

Mark Jeske

jbayer@ispi.UUCP (Jonathan Bayer) (08/10/89)

markj@infmx.UUCP (Mark Jeske) writes:

>Is it possible to automatically generating passwords and place the
>encrypted form in the /etc/passwd file?  I need to create about 1200
>random passwords.  I'm running xenix 2.3.2 on a ps/2 model 80.


What about the rest of the passwd entries, the user name, etc.?



JB
-- 
Jonathan Bayer			      Beware: The light at the end of the
Intelligent Software Products, Inc.	      tunnel may be an oncoming dragon
500 Oakwood Ave.				...uunet!ispi!root
Roselle Park, NJ   07204    (201) 245-5922    jbayer@ispi.UUCP

fyl@ssc.UUCP (Phil Hughes) (08/16/89)

In article <2037@infmx.UUCP>, markj@infmx.UUCP (Mark Jeske) writes:
> Is it possible to automatically generating passwords and place the
> encrypted form in the /etc/passwd file?  I need to create about 1200
> random passwords.  I'm running xenix 2.3.2 on a ps/2 model 80.
> 
> Thanks for any help.
> 
> Mark Jeske

This is what I use to generate passwords.  Fancy, no, but, it works.
You can muck with valid to both change what you put in the entry and
the distribution (want more numbers, put them in more than once, etc).
It seems, however, like you have a lot of other problems like
making the rest of the password entry.  May I suggest awk?

---------------------------------------------------------------------

/* rpw.c -- random password generator */
void strand();
long time();
int rand();

char valid [] =
	{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"};

main()
	{
	int i;

	srand((unsigned)time((long*)0));
	for(i=0; i<8; i++)
		putchar(valid[rand() % sizeof(valid)]);
	putchar('\n');	
	}
-- 
Phil Hughes, SSC, Inc. P.O. Box 55549, Seattle, WA 98155  (206)FOR-UNIX
    amc-gw!ssc!fyl or uunet!pilchuck!ssc!fyl or attmail!ssc!fyl