Created
August 28, 2024 15:21
-
-
Save blackvoidx/4cadd80bc408be21f36ec1c36a97f2d9 to your computer and use it in GitHub Desktop.
Random Password Bash function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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