Generate an assortment of random passwords with a simple command.

Generate secure passwords for your user accounts

The pwgen command will generate a set of random passwords that may be used to secure your user account.
Type this command to install this utility.

[email protected]:~# apt-get install pwgen

Now we can generate a few passwords.

jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc$ pwgen -s -v
79lZrgzb ctklTCV3 zX3nDCQr FXk5g7V8 v7Jd8QbW L9Zxrr86 79Q89Bdw pljWpST7
m64dX4MD GmD3RKjS M3dL6cZK C4mHWgzc DD36ppKM w37VmLV8 3CP9nM55 HQKF2PTw
5WcwKm8J tBx68rjc 5zGm6mb6 CgPR8Ttq KPGSCz4r HfW9LnV4 TV85xh9v ZxvqV99c
4P5v4RkH qm7nZRsM VzF5DpRf 64lgMMxf 8FlhjMqk WsX2wjJw Tv6qXnkZ jwplt7P3
bGlPV5Kp tkcCJHP6 Mgv3MX76 dg3W5b2S x3gG9h7h 7sjlRRHd 3wJZf54w Ckj9D2h2
zsJr3Rpn mPkNSsz5 6BGF9zS3 KqW7jDrv 2MDmfw6k vgD82flp KXws2hdk ss6psR39
BzCln48S dJx8ZqWT 8NXfKzxM 6BJtsJZ4 wmWgrnv6 dvr6SNb4 Tgd6PVTD qmL7FwFJ
37nVjmxS J8lhvs2w C9gDpq4m Ss35bvcF nfk2vFSP rWxslN9P QxH8WLXH zvpng6pG
lfb7S3JV kLcL5Gd5 K2N5GTNf bZwKm8W2 D3RMwkHg wPDzNb27 9JtH9ZHQ qjxP9VBS
T9R9CG8n pSZqP7P6 zLZnNj22 s7MNDWNT ZNrQRs9L 9W9NT9wJ P5nXMZq2 Rx75CS8S
gDGlSN74 rddGpkw7 n6fBFdMH gWVXVF6f rlvqd9X8 NH3fqtjT d3NnMdsD hL5dv924
5VlxQcwb dZ86VF32 g6kFS64L Pw7P3LHs 98jLV5Vf 5cZsnDBS rB7V7bZ6 slNzTgd7
sFvj9SCZ nqHSsQn4 nNLzZ9B3 k7wqNHgR dbXshQ27 44JPkh94 HhsqxJZ7 L7dLNJXD
GJLd7dFZ wbJHzbF5 k8LTVKbq 2rBlBvCw f48dHZF4 JFWkZ8JG nKNf9fLC PZqS5QBd
b7FdKZvX 5H27vQmG RKSh7Fzc PJdXk6pM BDJzXP8Z Fznsd3Fs 8P7Kjkqf R56VNJwg
WhxQ9BMZ GTNC5Hlf tbX397xs RF3tgqCf 4rF7tpsv nn3Qtc7p mFg3tkXv Vq4J8Prz
26x5vnvQ KZ5cvHRQ CZq5gZfx Mxx8CJtW Dvj9gwkV dqxV6NBr hvKnC3jT rDJgQ5s4
MZVx5GTq DBv2TPhs Rxq3rSM3 lBxLL6cH fPT6ldlZ rFqgh3N7 6GjRzQDD VKs7zhB8
7L8pPLKC 9ZsD5Dfr S4D9dPPS KtJM63w4 z9LlPPvH 9c98KN2h nsw8zRbT M5Xj9x4d
N3N2FwXC tB3WBH5P 3rGfQXNf 47CdxGqF TGT8V9vr wJXXJF4N pLztnC3k Hd5rHDPb

Here is how to generate one long password.

jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc$ pwgen -s -v 96 -1
q3N9Dv3R76TgCbf9WTkBP8FGwSgpnpPBfFtHLb3gPPwq74T5Xv68Kr6K9QW9fpf79lqwHQbTGw3FvWkW7G2VlPdJcNLjZTnw

The -s parameter ensures that more secure passwords are generated. Longer passwords are preferable as they have more entropy and are harder to break.

Here we are generating a bunch of 19 character passwords.

jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc$ pwgen -s -v 19
tNNm22Xg6JsLPHqJtvP kP7s7PPbR85WszJqjpq 5hVzwVbLFGbbFx8G2zW J7QVBTwfqkGrtwzXb2s
CvTwKzlL4fLMQk5Qpzh vfV76FB5Zxg4zhQ2D2J xxtFcfGB9ZkJqnmTTZC ndH7nFFhNdXv6kKmhst
kZHqRzftDv9bxJjCKkJ zBGPg9GmD7zGWPlv4V5 2fSsQBwlSSvh7WKPT3Q mCBQbnHBj8ZqdhmNmDp
HmbcZlhQvWV3Vwq73ZS PbjF6KsmnCXRMDfxjFW gBBvLlG8mxJ5V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mZRrd vdCQH6xcBTbhGFt5SWV WWz3tGFxVN5sMcnngjQ 76g2vB2Pp9MWNLkw7R5
bsZvM32TVQT9LvpmnLg cPbzKT4hXsdhlPhD9nk sXJCZb8P2PZXm6dBzT7 gD8bDNx9JN7F3n2p3kh
njJvjprLmV5XPGPRS9b r6tkqTrbh9wfH2TVXdC SxCjrvFWdq4MNndxkfS LNcQHPrzv7Pdm2s29xz

This is one very useful utility to generate passwords for your Linux system.

Here is another way to generate a super secure password.

[email protected]:/mnt/c/Users/johnc$ cat /dev/urandom | strings | tr -dc 'a-zA-Z0-9!@#$%^&*()' | fold -w 160 | head -n 1

This will generate a 160 character secure password.

This command will generate 12 secure passwords.

jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc$ cat /dev/urandom | strings | tr -dc 'a-zA-Z0-9!@#$%^&*()' | fold -w 160 | head -n 12
HnJa3c%Mc!79mOrW*6hLZmPx@(WI8p3MGk9SHLArd^qJ035t#S4gF9Q^zHuu^fq9jAsPF9hT#qnsKSPa#P0LIsU$09JGE^5)9#ZOk9XE0#4W)DrNb*Wk023xF^VWloUOpuL0(k1#*A(d)jjYw!ar9yU0TG2*T6Z5
NO@ajupO4P2arrbyGlvNLjQ5vj3A@q#mwet5aVFIHaXI2U!4rx$dQeQOnaf59&yzndGC([email protected]!UulIuI5RZZTQ)o9Lr*1a2OlAw6B3iIyN5y42F8&O5e6JS54wgLiA$944PSEc%oo94YQOGIs3
vn6$#fey9ezl7polkXNNBC38DRjEJG#cwqTP$5KF4B33HGPBo*1wEX4b2lca4peq9^4YD9GiktMmjQ40jQ19HlCy!ugpPFn[email protected]$9NwL^^l(9atwIxs7djGp!UM
AVPU3i^LY&tymj%rx$h!GXCeC4whfofLYCfEqS46XAR)y&%DloHmQ%ziTK%l9LsVHtL@BSul!(4P@%XjoLd*UkP8Gq8I#WQ)vvmGD1aQDHKL7SN5)nTi7c50m7ZT)e)70)TCPfcO56nlOd(WrZQ)^rB4^3ETkbwo
*k3G0Uf6JzBqDC[email protected]#hzA29#nQKfieoa8srd1nulzSX)uBxYiXIhe7O$rED^HEC!PArnA!D6@(AF*0A*Hk*qt7&m19GBzEiIiFe0piBckCd6VuH5*El4GaM(Rr&NJG%j2gR)RrpDbM2o3&T$
5Glf^ijmGeMpL@(22Q(v2qb9fAdevwqO8Iz8H0A0kXpEvO*JIzJbIUaE%vLOcStf&%ruf%Dwbme2jEW^I62X#)d(Ug5uO7hfb8hB*C%bUKH0Y4Ld&[email protected]%vpW^rfBxwXvkLfDPngG^eFd9$vt&4uqd
Ym2s2WJBsih!Qd4(XjDH81)ypGXcO2K1Vz9$8!9h(vUVUrNma54WG$cBrF*2R9qFUSGHvlNXYoSHSvDrGRi@gMY6EsY$(czv^DlFf!D5QZJ0VIkwWTKCHyx0SjLRm^w@diQOIP2D4Xwg6DGn$vV1N^(^R^!QdGqF
[email protected]#ho)DbX0IaUY3Er2BeIP7$#KhIfzH&fCfe6XuyDxXle@%HJ6q1n8X&[email protected](t(A)sBWPI^nUaD&KTSq(GUbPEvnNQ5Co7kD!%$YXZnkwkAkNcgMoR7SOAabsIVFkKvwQqPN
IOXaQWj8dwTNKyFNf^4odI8irmQ(Q3CbMpZuxZgCn5i7w%W)Ex8RidD[email protected])dWG1LiE#M65Zt5t2FW)7V3v3f1nn%1rI4wX$*t#0Kh0Qv1)0j1!PsEPBQ!2INOI5N!GqMO8kQt(BPgBM&tlsW1S
!z$w^1YkIX6!w)@Zlt3z(sMJbAonULQBRT%XIESrpNmcV1Bup*!ppl5[email protected][email protected]&GxhPhYWiKY1t^*YW%*ugbv$#g%feWfjTQRBfR(^)0H7HknB&x%ge$
2EFljRVn59KUL!3!LDW$qVI*)HYx8#6DV(@bn%EebGH1vfPesOTda)uOU!u5UcOwOFqyMmgPrJE6vlXVyLFu21anf5^L%uxfWzByxlXI0([email protected])CK702Kf0VuZh6C9NHP5T0T&i$9xJMChkVmxCO4mfyjhZr
kVbJvHdQ8*u9COBhdyTC8i&X6tXEwsUE)XSd^NwikdNN*30)oc3iBFswfu5X7qlrWqdLEgFGS4JsSRDRF!xPleaJ3RFmS(K)ngZgK&X^ML!G55RK#cpY2InOiD3AQUJJdT2kth#KVP!e0GVIxBY#e*h0giwE0T&O

Finally, here is one more method.

jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc$ head -c 24 /dev/urandom | base64 | sed s/==//gi;
Kio1iaMh3YSeT1auh8ccABtcCr0sN6Bk

No comments have been made. Use this form to start the conversation :)

Leave a Reply