Random password generator: many, in columns, on command line, in Linux

22

10

A while back, I came across a random password generator for the command line that displayed a grid of "memorable" passwords. Output was something like this:

adam@host:~$ CantRememberThisCommand
lkajsdf   aksjdfl
kqwrupo   qwerpoi
qwerklw   zxlkelq

The idea was that you could run this utility while someone was looking over your shoulder, and still pick a password with some level of secrecy due to the large number of choices.

I cannot remember what this utility was called. Oh interwebs, can you help?

Annika Backstrom

Posted 2010-02-15T19:16:52.537

Reputation: 688

Not quite an answer to your question, but Steve Gibson has something like this available online at https://www.grc.com/ppp.htm

– Tom A – 2010-02-15T19:20:02.470

Answers

28

Sounds like you want pwgen.

alt text

There are also some interesting ways to do this without installing additional software, but the 5-letter command is a bit easier to remember :)

John T

Posted 2010-02-15T19:16:52.537

Reputation: 149 037

You're more than welcome :) – John T – 2010-02-15T20:49:46.910

I keep coming back to this page because roughly every 6 months I need to generate a password but forget the command! Thanks! – spikeheap – 2013-06-05T10:53:20.657

3

According to your example output pwgen is a good guess (see the answer of John T). But there are many such tools available:

  • pwgen - generate pronounceable passwords
  • gpw - program to generate pronounceable passwords
  • apg - generates several random passwords

Also password managers such as KeePassX provide a passwort generator (but it does not focus on commandline usage nor on pronouncable passwords).

lumbric

Posted 2010-02-15T19:16:52.537

Reputation: 628

2

No need to install extra packages as OpenSSL should be installed on most machines. we can use the following code to generate an random password:

openssl rand -base64 10

Jackliusr

Posted 2010-02-15T19:16:52.537

Reputation: 129

2This is very handy, but strictly speaking taking random bytes and encoding them as base64 string does not necessarily mean a random string. E.g. all 10 char passwords generated like this will end in '=' (because of padding). Also the only other non alpha numeric characters included in these are + and /, which may not be optimal. – Timo – 2016-10-26T12:25:10.893

2Use a value that is a multiple of 3 (e.g. openssl rand -base64 12) and there will be no trailing = or ==. – Daniel Earwicker – 2018-03-08T09:57:41.513

add alias newpass="openssl rand -base64 12" to shell config ie. ~/.zshrc for quick generation of random strings with newpass command – Sharak – 2019-02-04T11:39:40.123