10 ways to share a Linux system generating random passwords _linux

Source: Internet
Author: User
Tags base64 openssl

Usually people generate passwords are very confusing, one is not enough complexity is not safe, complex enough and can not manually tapping the keyboard to play together characters (but usually these characters are regular), using 1password or keepass This software generation can also be, However, looks like 1password to charge, since so we play a fun with Linux to generate random password play it;

One of the big advantages of Linux operating systems is that you can use up to hundreds of ways to do the same thing. For example, you can generate random passwords in dozens of different ways. This article describes 10 methods of generating random passwords.

1. Use the SHA algorithm to encrypt the date and output the first 32 characters of the result:

Date +%s |sha256sum |base64 |head-c Echo

The resulting results are as follows:

Ztnimgm0ndi5ogzjmwmxndlhzmjmngm4

2. Use embedded/dev/urandom and filter out characters that are not used everyday. This also outputs only the first 32 characters of the result:

</dev/urandom TR-DC _a-z-a-z-0-9 |head-c${1:-32};echo

The resulting results are as follows:

Pdj0xwz7exd_qb5b27bwwsm1hrf3a7cj

3. Random functions using OpenSSL

OpenSSL Rand-base64 32

The resulting results are as follows:

ryjwqjltlayex3j7ncbir20h1k/0cnqlneunytscfko=

4. This approach is similar to the previous urandom, but it works in reverse

TR-CD ' [: alnum:] ' </dev/urandom | Fold-w32 | Head-n1;echo

The resulting results are as follows:

Tpgudzf7sqtu4yyw2lvhmuqoziqi87

5. Using the string command, it prints a printable string from a file

Strings/dev/urandom | Grep-o ' [[: Alnum:]] ' | Head-n 32 | Tr-d ' \ n '; Echo

The resulting results are as follows:

W4v1iqtkmq8sidd9jxdqnpg8hpmoz8

6. This is a simpler version of using Urandom

</dev/urandom TR-DC _a-z-a-z-0-9 | Head-c32;echo

The resulting results are as follows:

Rmdlgspn_bm-izvfwz9bei0rf-jiy6gs

7. Use a very useful dd command

DD if=/dev/urandom Bs=1 count=32 2>/dev/null | Base64-w 0 | Rev | Cut-b 2-| Rev

The resulting results are as follows:

9+0rud4u3hmsdmlgd7j0sf/r09mzfdvbs28w+po2wca

8. You can even generate a password that can be entered only with the left hand

</dev/urandom tr-dc ' 12345!@#$%QWERTQWERTASDFGASDFGZXCVBZXCVB ' | HEAD-C32; Echo

The resulting results are as follows:

vtg3#tr4sagxg3z%# #WZG4ZQ @GZ $wdqF

9. If you use one of these methods each time, the better way is to save it as a function. If you do, you can generate random passwords at any time using only RANDPW after the first run of the command. Maybe you can save it to your ~/.BASHRC file.

RANDPW () {</dev/urandom tr-dc _a-z-a-z-0-9 | Head-c${1:-16};echo;}

The resulting results are as follows:

Vgbx8cno950riykzrppya4bvbavzby_x

10. Finally, this method of generating random passwords is the simplest. It can also be run under Windows with Cygwin installed. can also be run under Mac OS X. I'm sure someone will complain that this method generates passwords that are not random from other methods. But in fact if you use all of the strings it generates as a password, the password is random enough.

Date | Md5sum

The resulting results are as follows:

E0d057b46a9a78346cbd94b25e574e79-
Date | Base64

The resulting results are as follows:

mjaxnow5tcawn+acicazmeaxpsdmmj/mnj/lm5sgmtc6mda6mzygq1nucg==
Ifconfig | Md5sum

The resulting results are as follows:

7c4243742aa515d45c12deca31428a95-

Even if you want to generate a nuclear bomb launch code can be, the following is a birth code example;

Ifconfig | Base64

The resulting results are as follows:

Zw0xicagicagiexpbmsgzw5jyxa6rxrozxjuzxqgiehxywrkcia3odoyqjpdqjoyqjpcmdo5ncag
ciagicagicagicbpbmv0igfkzhi6mtkylje2oc4zljugiejjyxn0oje5mi4xnjgumy4yntugie1h
C2s6mju1lji1ns4yntuumaogicagicagicagaw5lddygywrkcjogzmu4mdo6n2eyyjpjymzmomzl
Mmi6yja5nc82ncbty29wztpmaw5rciagicagicagicbvucbcuk9brenbu1qgulvotklorybnvuxu
Sunbu1qgie1uvtoxntawicbnzxryawm6mqogicagicagicagulggcgfja2v0czoymdy3nty0igvy
Cm9yczowigryb3bwzwq6mcbvdmvycnvuczowigzyyw1lojakicagicagicagifryihbhy2tldhm6
Odg2ndugzxjyb3jzojagzhjvchblzdowig92zxjydw5zojagy2fycmllcjowciagicagicagicbj
B2xsaxnpb25zojagdhhxdwv1zwxlbjoxmdawiaogicagicagicagulggynl0zxm6mjazndkzntex
Icgxotqumcbnauipicbuwcbiexrlczozmjuynzuxniaomzeumcbnauipcgpsbyagicagicagtglu
Ayblbmnhcdpmb2nhbcbmb29wymfjayagciagicagicagicbpbmv0igfkzhi6mti3ljaumc4xicbn
Yxnroji1ns4wljaumaogicagicagicagaw5lddygywrkcjogojoxlzeyocbty29wztpib3n0ciag
Icagicagicbvucbmt09qqkfdsybsvu5osu5hicbnvfu6mty0mzygie1ldhjpyzoxciagicagicag
Icbswcbwywnrzxrzoju2otkzmsblcnjvcnm6mcbkcm9wcgvkojagb3zlcnj1bnm6mcbmcmftztow
Ciagicagicagicbuwcbwywnrzxrzoju2otkzmsblcnjvcnm6mcbkcm9wcgvkojagb3zlcnj1bnm6
Mcbjyxjyawvyojakicagicagicagignvbgxpc2lvbnm6mcb0ehf1zxvlbgvuojagciagicagicag
Icbswcbiexrlczozmzezmdcxosaomzeunsbnauipicbuwcbiexrlczozmzezmdcxosaomzeunsbn
auipcgo=

Above is the cloud Habitat Community small make up to everybody to share the Linux system to generate the random password 10 kinds of methods, hoped everybody likes.

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.