Random Password Generator (uses all chars, no repeated chars)

for i in {21..79};do echo -e "\x$i";done | tr " " "\n" | shuf | tr -d "\n"
Generates a password using symbols, alpha, and digits. No repeating chars.
Sample Output
Tx(%FB'9u3&f@Pt0h#iH"y2R4s!r$8q6cwE1bD5eU)7YgXavAIpGSdQWV`C

These Might Interest You

  • make password randomly, default 8 chars, using bash3.X only, no external program.


    1
    genpass(){local i x y z h;h=${1:-8};x=({a..z} {A..Z} {0..9});for ((i=0;i<$h;i++));do y=${x[$((RANDOM%${#x[@]}))]};z=$z$y;done;echo $z ;}
    twfcc · 2009-10-24 04:32:31 3
  • These are my favourite switches on pwgen: -B Don't include ambiguous characters in the password -n Include at least one number in the password -y Include at least one special symbol in the password -c Include at least one capital letter in the password It just works! Add a number to set password length, add another to set how many password to output. Example: pwgen -Bnyc 12 20 this will output 20 password of 12 chars length. Show Sample Output


    5
    pwgen -Bnyc
    KoRoVaMiLK · 2012-03-15 14:38:15 1
  • This command is a powerful "detoxifier" that eliminates special chars, spaces and all those little chars we don't like. It support several "sequences" so be sure to check your /usr/local/etc/detoxrc while at it... and maybe define your own Show Sample Output


    16
    detox -r -s utf_8 /path/to/old/win/files/dir
    renich · 2009-03-16 07:50:36 3
  • apg generates several random passwords. It uses several password generation algorithms (currently two) and a built-in pseudo random number generator. Show Sample Output


    -1
    $ apg -m 40 -a 1
    blz · 2013-07-26 14:13:49 0

What Others Think

You don't need the first echo, you can do: for i in {21..79}
purpleturtle · 371 weeks and 2 days ago
shuf?
SuperFly · 371 weeks and 2 days ago
Here's 3 more... date +%s | sha256sum | base64 | head -c 12 ; echo openssl rand -base64 9 < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};echo;
Habitual · 371 weeks and 2 days ago

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: