6.11 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>`lstb)*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


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0