Skip to content

Instantly share code, notes, and snippets.

@jamestalmage
Created April 29, 2015 18:19
Show Gist options
  • Save jamestalmage/0411a8267c58dd9f7a77 to your computer and use it in GitHub Desktop.
Save jamestalmage/0411a8267c58dd9f7a77 to your computer and use it in GitHub Desktop.
Command Line Random Password Generator

I manage a number of devices for customers that require I manually set them up with passwords. Rather than using LastPass to generate passwords (polluting my personal LastPass with "Generated Password for ..." links), I use this little script. It generates a random password, and pipes it in to my clipboard.

#!/usr/bin/env bash
GEN_PASS=$(dd if=/dev/urandom bs=1 count=9 2>/dev/null | base64 | rev | cut -b 2- | rev)
echo $GEN_PASS
echo $GEN_PASS | pbcopy
GEN_PASS=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment