pwgen

Generate random passwords (from which you may select "memorable" ones)

See: "man pwgen" for full details. Some Linux distros may not have pwgen included in the base distribution so you maye have to install it (eg in Mandriva Linux: "urpmi pwgen").
Sample Output
$ pwgen
Xae7iquu PaiPoo3u ieNiip9U Eegee6Oo tuGhohB3 doR4aesh IeK5phee aeShaeZ5
ohhohCo7 ahSheub0 Sheixoh2 eeVu5lah feex9IP7 Pie0ivie Leichie1 Eigexoo7
zae9zeeB aikoo9Go reiNoo1o aik1looV aiPh1Rai Ahsh1aku eeth8Iez Uen3woh7
nae0Ame4 Eimahqu0 Eic2aeh4 PhahV2eu vi4Ceeko oow3Ohng AhXaeph4 Aicai7ci
Goof0Yee AeSh1fah Yaif0oN9 ieSoo2Th aNg5aiSh Toe2ex0j aeloVe8W Zaiweip0
Ohgh7eCh Phohle6n AeJei5ei ooqu3Quo eih8ooTh BeeChex9 Oozo8oef Eisup3ih
doo3Dai6 ooWae5Ni ahd5yohP phie1uHo ahm5jooK phue7aiW Ief4daw8 pied7Run
eipah3Oh Faize1ei IkeeChu7 ruuth4Zu ReiKo2na Eeto5ahw Haep7ahj Aing8yee
nohv6Eer Haijae1V pheef8Oa eY8ishe4 ohg6Ohch uaChe6ai Oa6Ii2pi ohTeo4ph
ulahGux6 OoyaiCh9 shoxuLo4 ay3OhT6o The8fu6s Euquei5i Ilie9ooF Raixai4l
AJa0Eino ohNg6faM aGh7ieho Eiqueek2 wuhee8In meo5Loey shuaJo1x oyieveN1
lair4Oow Aijee9ae io5Aeghe WaiWae3r En3ohvae aeki4Pie Ieth3aij zai6lieT
fiequaB2 ruT7OhSe Iachei3o ai1aeYaL tee3jaiH ooh1Pai6 Ni7ohp6u ieQuagh9
ahjo6Pee en7Thooy kooC8yah Lee8Ait2 zoo3Phae Teesho2b oot9ADie ahX4ji4a
choot9Ae zahree4M foh4ICho ooH4aich Aeboo5gi cohb4uBi Zee1akah Yoo4ve8f
ohta3Tha xee1Eexu Phai9shi iiNeiRo1 Eich8ail ich6oi2P ahKa6Cia Ev4Aechi
Aeghah4n eeng8Ahv Ya4reeCe Quoh5cae cood9Eiw Mie9wooh shie9AiJ aNg4de9p
ohVi2abe eij9Eiqu eeMae9ae xekaeWo0 to2RuMoh Ooquib9b jaMoo7ai Hi3oobae
uKim0eiy ooGhe1ee Eirem1uo Aek3PheB thu0Ui1e gi2OhCh0 je9ooQui iar1Gaiw
Oiquoh5n zoon6Ey6 RaFe9tha eeS9fahk aish9Tha Ahngah8F Ash2phoo Eehahc7o

6
By: mpb
2009-03-28 11:43:21

These Might Interest You

  • The pwgen program generates passwords which are designed to be easily memorized by humans, while being as secure as possible. Human-memorable passwords are never going to be as secure as completely completely random passwords. [from pwgen man page] Show Sample Output


    6
    pwgen 30 1
    sairon · 2011-07-24 19:43:48 0
  • Use the excellent sensiblepasswords.com to a generate random (yet easy-to-remember) password every second, and copy it to the clipboard. Useful for generating a list of passwords and pasting them into a spreadsheet. This script uses "madebynathan"'s "cb" function (http://madebynathan.com/2011/10/04/a-nicer-way-to-use-xclip/); you could also replace "cb" with xclip -selection c Remove "while true; do" and "; done" to generate and copy only 1 password. Show Sample Output


    0
    while true; do curl -s http://sensiblepassword.com/?harder=1 | tail -n 15 | head -n 1 | sed 's;<br/>;;' | cut -c 5- | cb; sleep 1; done
    supervacuo · 2012-01-30 20:52:14 0
  • Generate a table of random 10 character passwords Show Sample Output


    1
    pwgen 10 # generate a table of 10 character random passwords
    mpb · 2012-10-26 08:57:47 0
  • Feel free to put this in your ~/.profile: random(){ cat /dev/urandom | env LC_CTYPE=C tr -dc $1 | head -c $2; echo; } Then use it to generate passwords: random [:alnum:] 16 Or DNA sequences: random ACGT 256


    2
    cat /dev/urandom | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 16; echo
    yakovlev · 2014-02-05 15:04:07 0
  • generate a table with 10 character ambiguous random passwords which include at least one special character in in password


    1
    pwgen -B -y 10
    DobeR · 2012-10-28 20:06:52 0
  • This was useful to generate random passwords to some webpage users, using the sample code, inside a bash script Show Sample Output


    2
    echo -n $mypass | md5sum | awk {'print $1'}
    tororebelde · 2009-03-10 13:12:21 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: