Skip to content

Instantly share code, notes, and snippets.

@forficate
Created January 7, 2017 12:56
Show Gist options
  • Save forficate/7c889b74c89b878352c52fc12ba044a7 to your computer and use it in GitHub Desktop.
Save forficate/7c889b74c89b878352c52fc12ba044a7 to your computer and use it in GitHub Desktop.
Random password generator shellscript
#/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: pass [size]"
exit 1
fi
PASS=$(openssl rand -base64 256 | tr -cd '[:alnum:]' | head -c${1:-$1})
echo $PASS | pbcopy
echo $PASS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment