Generate valid Unix username and password in Perl
From http://sysadminsjourney.com/content/2009/09/16/random-password-generation-perl-one-liner/
perl -le 'print map { (a..z,A..Z,0..9)[rand 62] } 0..pop' 8
Will generate a random 8 character string from the characters a-z, A-Z and 0-9 .
You should be able to modify this to generate the username and password.
Username would be:
perl -le 'print map { ([a-z_][a-z0-9_][rand 62] } 0..pop' 30
The password would be similar, but you would need to use the passwd
command to actually set it to the user. Not sure if Perl has an equivalent.