GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Wajig Password |
20200803 The password command will generate a
good password. By default a single password of length 16 is
generated. The number of passwords and the length of the passwords can
be specified. Punctuation is included with the --punct
option. Punctuation is often referred to as special characters.
In the first example we generate 5 random passwords of the default length. characters:
$ wajig password 5 ahR3eiNgohuuPh8p ieso6ohBahaiph9I Hainei2gudPhie3K Cai9Ieph3vkae6Ar be4Yeigha3Aez2ar |
Passwords of length longer than 12 are usually recommended, but you can choose shorter passwords if you like. Here's a set of passwords of length 10:
$ wajig password 5 10 Iw5ieWiew2 iengiem5ER reil4chole gae8shie4Y zai7eezaas |
Punctuation or special characters can be included:
$ wajig password --punct 5 ]'mq_lPNiv#F}&-Y !c17>`l\tb)*E_Os Ixml.ZUU,mW;_pp# KPAQL!L"-xty_FLW eQZo8XYea_Z=YrR* |
To find out what is happening underneath use the --teach
option:
$ wajig password --teach 5 pwgen 16 5 | tr ' ' '\n' ahR3eiNgohuuPh8p ieso6ohBahaiph9I Hainei2gudPhie3K Cai9Ieph3vkae6Ar be4Yeigha3Aez2ar |
Knowing this we can create a file of random usernames (generated as user followed by two random characters) and passwords (of length 15) which can be used to add users to the system. A simple bash command line is:
for i in {1..5}; do u=`pwgen 2` p=`pwgen 15` echo user$u:$p done |
The output looks like:
userji:haelio9ohphieSa userdi:CaiQu8leiShaewe userHV:hoo1uhahPeew7ee userrT:ohcemai5jiekeXi userOB:eemahMaeQuoo6Ao |