In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to generate high-strength passwords under Linux. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.
1. Using OpenSSL in Linux to generate a strong password
Openssl is used in all Unix-like distributions, Solaris, Mac OS X, and Windows
To generate a random password using OpenSSL, open a terminal and run the following command:
openssl rand -base64
The "-base64" parameter above will ensure that the generated password can be typed out by the keyboard.
Sample output:
wXCHXlxuhrFrFMQLqik
The above command will generate a random strong password of 14 characters in length. We strongly recommend that you generate a password of 14 characters. Of course you can use OpenSSL to generate passwords of any length.
For more information, refer to the online manual:
man openssl2. Using Pwgen to generate a strong password in Linux
pwgen is a simple but very useful command-line tool that can generate a random and strong password in a short time. It designs security codes that people can remember more easily. It is available on most Unix-like systems.
To install pwgen in DEB-based systems, run:
sudo apt-get install pwgen
In an RPM-based system, run:
yum install pwgen
In Arch-based systems, run:
sudo pacman -S pwgen
Once pwgen is installed, you can generate a random strong password of 14 characters using the following command:
pwgen 14 1
Sample output:
Choo4aicozai3a
The above command will generate a password that is 14 characters long. If you want to generate two different passwords that are 14 characters long, you can run:
pwgen 14 2xee7seerez6Kau Aeshu0geveeji8
If you want to generate 100 (though probably not necessarily as many) different passwords of 14 characters long, you can run:
pwgen 14
Sample output:
pwgen 14 100
Sample output:
kaeNg3EiVei4ei Oo0iehiJaix5Ae aenuv2eree2Quo iaT7zahH1eN2Aj Bie2owaiFahsiegaan9zu5Xeh6ah ahGeeth8ea5ooh Ir0ueda5poogh6 uo0ohqu2ufaiX2 Mei0pee6Og3zaeOofeiceer8Aipu sheew3aeReidir Dee4Heib2eim2o eig6jar8giPhae Zahde9nae1Niewquatol5Oi3Bah3 quue4eebaiNgaa oGoahieSh6oL4m aequeeQue2piti laige5seePhugoiiGo9Uthee4ros WievaiQu2xech7 shaeve0maaK3ae ool8Pai2eighis EPheiRiet1ohciZieX9outhoht8N Uh2UoPhah3Thee reaGhohZae5idi oiG4ooshiyi5in keePh2ohshei8yaim5Eevah3thah Xaej8tha5eisho IeGie1Anaalaev gaoY3ohthooh4x chaebeesahTh8esoh7oosieY5eiD ahmoh7Ihii6que Shoowoo5dahbah ieW0aiChubee7I Caet6aikai6aexcoo1du2Re9aika Ohnei5Egoh7leV aiyie6Ahdeipho EiV0aeToeth2da iNgaesu4eeyu0SEeb1suoV3naera railai2Vaina8u xu3OhVee1reeyu Og0eavae3oohoh audahneihaeK8afoo6iechi5Eira oXeixoh7EwuboD we1eiDahNgoh9s ko1Eeju1iedu1z aeP7achiisohr7phang5caeGei5j ait4Shuo5Aitai no4eis9Tohd8oh Quiet6oTaaQuei Dei2pu2NaefeCaShiim9quiuy0ku yiewooph4thieL thu8Aphai1ieDa Phahnahch2Aam1 oocex7Yaith8ooeraiGaech6ahNg neixa3malif5Ya Eux7chah8ahXix eex1lahXae4Mei uGhahzonu6airuyah8uWahn3jeiW Yi4ye4Choongie io1Vo3aiQuahpi rie4Rucheet6ae Dohbieyaeleis5xi1Zaushohbei7 jeeb9EiSiech0u eewo0Oow7ielie aiquooZamah6th kouj7Jaivohx9obiyeeshesaDi9e she9ooj3zuw6Ah Eit7dei1Yei5la xohN0aeSheipaa Eeg9Phob6neemaeengoneo4saeL4 aeghi4feephu6W eiWash3Vie1mee chieceish6ioPe ool4Hongo7ef1ojahBe1pui9thou eeV2choohoa4ee Ohmae0eef4ic8I Eet0deiyohdiew Ke9ue5thohzei3aiyoxeiva8Maih gieRahgh8anahM ve2ath9Eyi5iet quohg6ok3Ahgee theingaech6Nef
If you want to include at least 1 number in your password, you can run:
pwgen 14 1 -n 1
Sample output:
xoiFush4ceiPhe
The pwgen command also has some useful options:
-c or--capitalize Contains at least one capital letter-A or--no-capitalize Contains no capital letters-n or--numerals Contains at least one digit-0 or--no-numerals Contains no digits-y or--symbols Contains at least one special character-s or--secure Generates a completely random password-B or--ambiguous Contains no indistinguishable letters in the password For example, 0 and o, 1 and l-h or--help output help information-H or--sha1=path/to/file[#seed] uses the sha1 hash value of a given file as a random number generation seed-C outputs the generated password in columns-1 outputs the generated password in columns-v or--no-vowels does not use any vowels to prevent the generation of dirty words ```
For more information, please consult their online brochure:
man pwgen3. Using GPG to generate a strong password in Linux
GPG (GnuPG or GNU Privacy Guard) is a free and open source command-line program that can be used as an alternative to Symantec's PGP encryption software. It is available on Unix-like operating systems, Microsoft Windows, and Android.
To generate a strong 14-character password using PGP, run the following command in the terminal:
gpg --gen-random --armor 1 14
Sample output:
DkmsrUy3klzzbIbavx8=
The above command will generate a secure, random, strong password based on base64 encoding.
4. Using Perl to generate a strong password in Linux
Perl is available in the default repository of most Linux distributions and you can install it using the appropriate package manager.
For example, on a DEB-based system, you can install Perl by running the following command:
sudo apt-get install perl
Installing Perl on an RPM-based system runs:
sudo yum install perl
In Arch-based systems, run:
sudo pacman -S perl
Once the Perl installation is complete, create a file using the following command:
vi password.pl
Then add the following to this file:
#!/ usr/bin/perlmy @alphanumeric = ('a'.. 'z', 'A'.. 'Z', 0.. 9);my $randpassword = join '', map $alphanumeric[rand @alphanumeric], 0.. 8;print "$randpassword\n"
Save and close the file.
Next, switch to where you saved the file and run the following command:
perl password.pl
Replace "password.pl" in the above command with a filename of your own definition.
Sample output:
3V4CJJnYd on "How to generate high-strength passwords under Linux" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.