Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was hoping someone could recommend a good password generator.

Extra props to the person who can name one that gives you a mnemonic to remember it as well.

share|improve this question
You could always just 'echo "random" | md5sum' :) – Nathan Osman Feb 7 '11 at 0:41
@GeorgeEdison Why stop at md5? echo 'keyword' | sha1sum – Marco Ceppi Feb 7 '11 at 14:12
@George @Marco haha nice trick. – myusuf3 Feb 7 '11 at 16:19
dd if=/dev/random bs=32 count=1 2> /dev/null | md5sum | cut -b 10-20 Should give you about 40 bit entropy/security. – Torkel Bjørnson-Langen Feb 16 '15 at 22:28

17 Answers 17

up vote 21 down vote accepted

Aberystwyth University has a pretty hardcore mnenomic-passsword generator.

Generates evil password like this:

<1n255s4    Lisa's first newt zooms Fife's fifth shrewd four.
t6pnjsnv    Tony's sixth padlock nags John's spectacular number vainly.
fqyumdc8    Fiona's quadrilateral yucca understands Murray's dormant calculating eight.
ee6pk3cm    Eve's egocentric six ponders Ken's third cagey magazine.
q1giwn?n    Quentin's first galaxy improves Wyn's nondescript question mark nastily.

Interesting work. You might like to email their sysops to see if the script behind it is freely available (and if it's not, whether they'd consider GPLing it)

Edit: Looking at the output a little more cafefully, this would not be hard to code. You'd just need several dictionaries to feed it.

share|improve this answer
Seems like you'd need a mnemonic to remember the mnemonic. – belacqua Feb 7 '11 at 6:53
but how can one have a < in the password? in an international setting were you have different keyboards I would not recommend this. – Marcel Feb 9 '11 at 7:49
I haven't looked at this generator, but I hope it lets you generate passwords longer than 8 chars. 8, even with special chars, is well within the realms of instantaneous rainbow table pwnage, if the hash is ever grabbed (and this happens a lot!) – Rory Alsop Jun 29 '11 at 8:59
The funny part is that if you can remember that mnemonic, you could have used it as a password from the start. Passwords should be easily memorizable, but hard to break. These passwords are flawed both ways. – Jul 1 at 12:53

pwgen Install pwgen generates random, meaningless but pronounceable passwords. These passwords contain either only lowercase letters, or upper and lower case mixed, or digits thrown in. Uppercase letters and digits are placed in a way that eases remembering their position when memorizing only the word. .

Install pwgen with the button below:

Install via the software center


sudo apt-get install pwgen
share|improve this answer
pwgen is also available for cygwin – jan Oct 31 '14 at 10:31

apg Install apg

APG is the Advanced Password Generator. The software is used to automatically generate new passwords for whatever use you feel like putting it to.

Here are some key features of "APG":

  • Setting maximum percentage of special characters
  • Setting the length of generated passwords
  • Grouping characters
  • Setting a number of passwords to generate
  • Setting a random seed file
  • One Time Pad Generation
  • Printing how many passwords it generated in how many second

To install, run this command:

sudo apt-get install apg

Install and using Apg with this help guide

share|improve this answer
Both the author's page for apg and the Ubuntu page you link to refer to it as "Automated" rather than "Advanced". Several of the bulleted points in this answer don't seem to be currently supported (if they once were), notably percentage of special characters, a seed file, One Time Pad, generation rate. – Dennis Williamson Aug 13 '15 at 21:01

Try the password card. You carry it in your wallet and you remember two symbols and a color.

You read the letters / numbers between the symbols along a color line, or make up any algorithm that you can remember.

The site generates a random card for you.

Password card

share|improve this answer
Brilliant thing! Thanks! – aim Jun 3 '15 at 10:26

No mnemonics, but pwgen is pretty straightforward.

share|improve this answer

The results are more hideous even than apg or pwgen (even with the -s option set), but this is more fun:

head -c 8192 /dev/urandom  |   strings --bytes 8 | sed 's/\s//'

I suspect your use case if different, but this kind of thing is useful for shared secret keys, and other kinds of passwords that you don't type in very often.
To get a larger selection, pass more bytes to head, and to get longer password result strings, modify --bytes in strings (which gives a minimum length). the sed expression strips out strips out spaces and tabs (represented by \s).

However, you will at some point probably appreciate applications (like pwgen, KeePassX or LastPass) that give you an option to avoid easily confusable characters, like 1 and l and I . These can look like 1Il or 1Il or worse. You would want to use an option like this if you are resetting someone's password or giving a one-time passkey that needs to be communicated.

Stil, pwgen put gives this caveat in its man page, describing its -B option:

   -B, --ambiguous
          Don't use characters that could be confused  by  the  user  when
          printed,  such  as 'l' and '1', or '0' or 'O'.  This reduces the
          number of possible passwords significantly, and as such  reduces
          the  quality  of  the passwords.  It may be useful for users who
          have bad vision, but in general use of this option is not recom‐

This is nuts, of course. You probably know when this is useful or not. And it's certainly better than using 'Pa$$w0rD' for everything. If in doubt, create a longer password, or pass your generated password as input to another generator, or use multi-factor authentication.

share|improve this answer

I use mkpasswd. While technically it is used to encrypt a password for use inside an /etc/passwd file, it also gives nice strings of characters suitable for passwords.

share|improve this answer
Can you reference a source about how suitable this is for password generation? – ThorSummoner Jul 24 '15 at 17:07
It's 25 rounds of 56 bit DES, with a small modification. I doubt there is an algorithm that can enumerate the generated bit patterns without introducing duplicates, so knowledge of the algorithm used would not give an advantage to an attacker, except that the length is known in advance. – Simon Richter Jul 24 '15 at 19:41
I doubt however that this has been actually explored by cryptanalysts. The search space obviously depends on the random data that went into the algorithm -- if it is known that all you do is mash the keyboard, that is a smaller space than actually using 56+12 bits from a good RNG. – Simon Richter Jul 24 '15 at 19:45

Keypass has a built in password generator. Generate your new password and remember it with the same tool.

share|improve this answer
And they're properly evil. Like, 32 character randomly generated evil. You'd need keepass to remember the passwords it generates. :-) – Scaine Feb 8 '11 at 0:38

I use apg -- sudo apt-get install apg

share|improve this answer

SuperGenPass is a bookmarklet solution originally intended for website logins, but it can easily be used for applications, too. It uses a master password plus the current domain name (or application name, if you like) to generate 10-character passwords like lCY9gjiDtF. It doesn't need mnemonics because it can one-click auto-fill the password box, and allows copy/paste into other applications too.

I keep a bookmarklet in each of my browsers, and on my cell phone (works offline, too!). It's very convenient. If you're "brave" then you could even hardcode the master password into the bookmarklet.

share|improve this answer

I use FPM2 (figaro) password manager. No mnemonics, but you have a password generator, and you just have to keep in mind one password. Simply search it in Software Center.

Or, if you like a "low-tech" but ingenious solution, you can watch at this:

share|improve this answer

I got some pretty good feedback with brain-generated passphrases.

Password please :
¡I don't use p4sswords with known fixed p4tternS!

Alas it's not a free generator, because it works better with a cup of coffee, nor is it open-source (but kinda difficult to hack).

share|improve this answer

Here's a JavaScript bookmarklet. It will ask for the length and then create the password. Just create a new bookmark with the following address:

javascript:(function(){var d=prompt("Password length","14");if(d){for(var e="",a=Math.random,b=Math.floor,f=0;f<d;f++)x=62*a(),x<=10&&(c=48+b(10*a())),x>10&&x<36&&(c=65+b(26*a())),x>=36&&(c=97+b(26*a())),e+=String.fromCharCode(c);prompt("Password",e)}})()

For those interested, the above bookmarklet was using the below code, minified with Closure Compiler:

(function () {
    var n = prompt("Password length", '14');
    if (n) {
        var s = "",
            r = Math.random,
            f = Math.floor;
        for (var i = 0; i < n; i++) {
            x = 62 * r();
            if (x <= 10) c = 48 + f(10 * r());
            if ((x > 10) && (x < 36)) c = 65 + f(26 * r());
            if (x >= 36) c = 97 + f(26 * r());
            s += String.fromCharCode(c);
        prompt("Password", s);
share|improve this answer
Your old code was leaking the password to the webpage. This function makes it a bit more secure (providing that the webpage does not overwrite the used functions to capture the arguments ;)) – Lekensteyn May 27 '11 at 19:58

I found a good website with a few interesting options for password generation, strength testers etc. It is prints the password out as mnemonic.

It isn't flawed terribly like some of the major websites that people are currently using for password generation and testing.

share|improve this answer is a free online generator?

share|improve this answer

Has Revelation been considered? Not only will it generate the password, it will assist in keeping track of them.

share|improve this answer

Mozilla has a little Flash video on a password schema you might enjoy at

share|improve this answer

protected by fossfreedom Nov 21 '13 at 11:26

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.