Generating passwords

Last Updated on 04/03/2017 by dboth

Passwords are a key component of security for all operating systems and even for computer hardware. Generating good passwords can be a challenge, especially when we all need so many of them. A good password generating program can be used in aid of this.

I use one called pwgen and it can generate passwords that can meet any need. For example, just entering the pwgen command can generate a list of 8 character passwords that are – supposedly – easily remembered by humans.

$ pwgen 
amae7Ohb Ogic6ahk Jah3agh3 AhchaiS4 bahPae2f waa3eiBe Neigho8z Ohg9eequ 
chah9Too aed6Iexi quaZ9Ri5 OhP4ei3z Muwa2xah baeT5eiR iNg9Ohxa buuD3aeT 
yae9Phah Hile6bie Eun6Em3k ooB0aht3 Neichee8 Goh1aeJo quien2Ph Oim0Pohf 
Fiet9iDe jae5Ieng Phooz1Po queLei2u Ahph9lai euCh5iel aesh8Iel Gae3ieho 
Seb8paib zi5ajuiM Ooshi8Ur Ieyoh2ad eicoeK5f ahShai0A ei7Mohch wuFae9oo 
Chaezae2 zeigaiV0 ohnae2Ye aeF5aiw6 uquai7Cu lu9Ien8U Nais6uqu Noy3zaxi 
eiLehei9 aeL8Eej2 Bil3eNu3 We3gahw1 Wua6xacu eichah5A doojaD8i aeriP9Ji 
la8iiNga Ne2gai8t EeCoo0Ro Aezou7ai eihaiB2o Iu8gai6u Aechah2n Zuewah2u 
Ce1airie nos4ohFu eixiRoo3 Uu1ohk3h looKei2o Xoh0eire BiebuY3o quoGhei6 
edu5Piu0 eG3bisoh aTh7Aen3 ahth0Eib Ii6phohp toh1beeZ ye7uiv6E zei5Johx 
aiGa8ahd Doa7Mae4 Oofeeg3a da1ahChi Iweecu1o Viyez3ug eeThai9x Ao6engai 
Omoh7Loo Ieghieh9 Cho5oof3 Umoohei5 ro8Caema Iequ1ooj Ea8aur1e yoi7RohS 
Eishoog9 doo3Joh8 ooShee1x Aev2sai1 ZaiDuvo8 thahng3A Aet6giji AeCh6dao 
choo7Tho Ieda1jao beew3Tae EYa5etha quae7Iem io4Heey0 ohthaaP0 EeZae6hi 
eij5AiHo tohGha9w Iedoi9ei Iu6gocha chagee8G equ5Jain fu9Direu ohgh9Voo 
yeeRaeg1 Ahhaix7l aeQuie6w Ish4che2 Eexoo3le voopha8J WuCung2d Foe1zo4i 
tho4aaPh aNgai2Oa payaep1H ahg6Geez boox4Xae Aiph3iC0 viNgau7u Hah4Soov 
Phiy5phu Vah5Uo2y ushoqu8K Aeshoow8 aejieK7y xooC3you waTae0oi eishoh5R 
phu4IeHa aiSahj6u ov1OhFai Eeng6roo ahG3eek4 Cae5cheb ii0Chaig Loh4Aere 
Eimee3Le Onongo9e Iex7fag2 ag7Ahr6o weiDivi9 iib6Phoh che4Fu7X Oip7beiz

Just pick the one you want to use.

Sometimes more complex passwords are needed, so the pwgen command has some options and one argument that can be used to make them longer and use more characters. For example using the -s option creates passwords that are completely random and hard to memorize and the -y option will create passwords with at least one special character, such as *^$)(, in them. The -N option specifies how many passwords to generate.

The one argument is simply append a number to the end of the command that specifies the number of characters that are to be generated in each password.

My preferred usage and the results are shown below. This gives me a large number of very secure passwords from which to choose.

$ pwgen -sy 10 
VAO$r2h,b_ X5A"|Jw-(L m8QW\KuYwx F!rCN1r*O< q5G7<t8T(} ch%FvoP7oY za/M&M1g/R 
uD8Y[N;?k= wj=\J3$3CI dSH/bWn0[r 50H5w:C)Yz +ss9vU1V9M Ne(x[pV9:. _u*=!^%5Yw 
~27HbCc;9) #9$^\UnFf> 9_LaZe~44I V{`h7Yembx M."Q1{ql]k Ep5K?W=2.L lTQ]Z9m%yA 
\>LrwQTBr9 *)cF6mBsab /?iN=5-L95 IliR$G6f#~ .&%5'4mO%; D_x|t~5})> G{nJ{2!4|$ 
ZN:E=GB4Iq E!?Y^ufO9. ueA(Yx0Wks s'UNiQ0SR. G9$7iJ:hvx Xd0.kBlvxC D20XpA`M}" 
-7Ps'EVTBB *NmF5__uqr >;:B)C^9Fn 3zqi`nEcEL -$<S2XM#w@ !5t+Fx:.QB 8CG}WFF@gR 
Fe:#RN4\O> ^fvB%C:M03 /Xl'H4f%Y2 `De'745ynS 2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secure passwords. So I have generated some that were 100 characters in length and used every class of character on the keyboard.

Just be aware that I find the sequence of the s and y options to be critical. If you use the sequence “-ys” the results do not include special characters. This is undoubtedly a bug.

There are other password generators out there and they all do a fine job. I find that pwgen works well for me.