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

13,115

Solution 1

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 :)

Solution 2

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).

Solution 3

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
Share:
13,115

Related videos on Youtube

Moiz
Author by

Moiz

Updated on September 17, 2022

Comments

  • Moiz
    Moiz over 1 year

    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?

    • Tom A
      Tom A over 14 years
      Not quite an answer to your question, but Steve Gibson has something like this available online at grc.com/ppp.htm
  • John T
    John T over 14 years
    You're more than welcome :)
  • spikeheap
    spikeheap almost 11 years
    I keep coming back to this page because roughly every 6 months I need to generate a password but forget the command! Thanks!
  • Timo
    Timo over 7 years
    This 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.
  • Daniel Earwicker
    Daniel Earwicker about 6 years
    Use a value that is a multiple of 3 (e.g. openssl rand -base64 12) and there will be no trailing = or ==.
  • Sharak
    Sharak over 5 years
    add alias newpass="openssl rand -base64 12" to shell config ie. ~/.zshrc for quick generation of random strings with newpass command