Linux generates high-strength passwords

Source: Internet
Author: User
Tags base64 base64 encode openssl

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.