Last active
November 4, 2024 04:24
-
-
Save vpnwall-services/ddb8a6b81d8d9460cd8d73f2b0ec3457 to your computer and use it in GitHub Desktop.
[Generate random password] Generate a password randomly #linux # generate #password
This file contains 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
#!/bin/bash | |
# Echo three passwords | |
cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%+'|fold -w 28| head -n 3 | |
# Echo one password and put it in clipboard | |
# Requirements: apt-get install -y xclip | |
cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%+'|fold -w 28| head -n 1|xclip" | |
openssl rand 60 | openssl base64 -A | |
# another method (suitable for alerta) | |
LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c 32 && echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment