In writing, automation scripts. Often need to add account and password. How to automate the filling of random passwords , a bit of a meaning ....
01. OpenSSL generates a password
[[email protected] ~]# OpenSSL rand-base 14usage:rand [options] num
Where options are
-out File-write to File
-engine E-use engine E, possibly a hardware device.
-rand file:file: ...-seed PRNG from files
-base64-base64 encode output
-hex-hex encode output
OpenSSL rand-base64 8
OpenSSL Rand-hex 3-out pass.txt--6-bit
02. Use Urandom to generate high strength password
Use the TR condition to filter the output of the/dev/urandom, thereby deleting the unwanted characters and printing out the first 14-bit characters that appear
</dev/urandom TR-DC A-za-z0-9 | Head-c14; Echo
</dev/urandom TR-DC A-za-z0-9 | Head-c6;echo
03. Set Shortcut Commands
Vim/etc/bashrc
GENPASSWD () {
</dev/urandom tr-dc ' [: alnum:] ' | Head-c6;echo
}
Linux generates high-strength passwords