Skip to content

Instantly share code, notes, and snippets.

@blackvoidx
Created August 28, 2024 15:21
Show Gist options
  • Save blackvoidx/4cadd80bc408be21f36ec1c36a97f2d9 to your computer and use it in GitHub Desktop.
Save blackvoidx/4cadd80bc408be21f36ec1c36a97f2d9 to your computer and use it in GitHub Desktop.
Random Password Bash function
randompass() {
local length="${1:-15}" # Default password length is 15 characters
local password
password=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | head -c "$length")
echo "$password"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment