{"id":45042,"date":"2023-04-02T01:25:39","date_gmt":"2023-04-01T17:25:39","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=45042"},"modified":"2023-04-02T01:25:39","modified_gmt":"2023-04-01T17:25:39","slug":"passwd-strong-four-methods","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/passwd-strong-four-methods.html","title":{"rendered":"linux\u4e0b\u751f\u6210\u9ad8\u5f3a\u5ea6\u5bc6\u7801\u7684\u56db\u5927\u795e\u5668"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5b89\u5168\u662f\u4e00\u4e2a\u5927\u7684\u8bdd\u9898\uff0c\u7ed9\u670d\u52a1\u5668\u8bbe\u7f6e\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u7684\u5bc6\u7801\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f60\u53ef\u80fd\u4f1a\u7591\u60d1\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u7684\u5bc6\u7801\u7a76\u7adf\u662f\u4ec0\u4e48\u6837\u7684\u5462\uff1f\u600e\u4e48\u624d\u80fd\u751f\u6210\u4e00\u4e2a\u90a3\u6837\u7684\u5bc6\u7801\u5462\uff1f\u4e0d\u7528\u62c5\u5fc3\u4e0b\u9762\u6211\u4eec\u5c06\u4ecb\u7ecd 4 \u79cd\u7b80\u5355\u65b9\u6cd5\u8ba9\u4f60\u5728 Linux \u4e2d\u751f\u6210\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u5bc6\u7801<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1. \u5728 Linux \u4e2d\u4f7f\u7528 OpenSSL \u6765\u751f\u6210\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u5bc6\u7801<\/strong><\/div>\n

\u5728\u6240\u6709\u7684\u7c7b Unix \u53d1\u884c\u7248\u3001Solaris\u3001Mac OS X \u548c Windows \u4e2d\u90fd\u7528openssl\u8fd9\u4e2a\u5de5\u5177<\/p>\n

\u8981\u4f7f\u7528 OpenSSL \u751f\u6210\u4e00\u4e2a\u968f\u673a\u5bc6\u7801\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

openssl rand -base64<\/pre>\n

\u4e0a\u9762\u7684\"-base64\"\u53c2\u6570\u5c06\u786e\u4fdd\u751f\u6210\u7684\u5bc6\u7801\u53ef\u4ee5\u88ab\u952e\u76d8\u6572\u51fa\u6765\u3002<\/p>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

wXCHXlxuhrFrFMQLqik<\/pre>\n

\"\"<\/p>\n

\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u751f\u6210\u4e00\u4e2a\u968f\u673a\u7684\u3001\u957f\u5ea6\u4e3a 14 \u4e2a\u5b57\u7b26\u7684\u9ad8\u5f3a\u5ea6\u5bc6\u7801\u3002\u6211\u4eec\u5f3a\u70c8\u63a8\u8350\u4f60\u751f\u6210 14 \u4e2a\u5b57\u7b26\u7684\u5bc6\u7801\u3002 \u5f53\u7136\u4f60\u53ef\u4ee5\u4f7f\u7528 OpenSSL \u751f\u6210\u4efb\u610f\u957f\u5ea6\u7684\u5bc6\u7801\u3002<\/p>\n

\u8981\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff0c\u53ef\u4ee5\u53c2\u8003\u8054\u673a\u624b\u518c\uff1a<\/p>\n

man openssl\r\n\r\n<\/pre>\n

\"\"<\/p>\n

2. \u5728 Linux \u4e2d\u4f7f\u7528 Pwgen \u6765\u751f\u6210\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u5bc6\u7801
\n<\/strong><\/div>\n

pwgen \u662f\u4e00\u4e2a\u7b80\u5355\u5374\u975e\u5e38\u6709\u7528\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u5b83\u53ef\u4ee5\u5728\u77ed\u65f6\u95f4\u5185\u751f\u6210\u4e00\u4e2a\u968f\u673a\u4e14\u9ad8\u5f3a\u5ea6\u7684\u5bc6\u7801\u3002\u5b83\u8bbe\u8ba1\u51fa\u7684\u5b89\u5168\u5bc6\u7801\u53ef\u4ee5\u88ab\u4eba\u4eec\u66f4\u5bb9\u6613\u5730\u8bb0\u4f4f\u3002\u5728\u5927\u591a\u6570\u7684\u7c7b Unix \u7cfb\u7edf\u4e2d\u90fd\u53ef\u4ee5\u83b7\u53d6\u5230\u5b83\u3002<\/p>\n

\u5728\u57fa\u4e8e DEB \u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5 pwgen \u8bf7\u8fd0\u884c\uff1a<\/p>\n

sudo apt-get install pwgen<\/pre>\n

\u5728\u57fa\u4e8e RPM \u7684\u7cfb\u7edf\u4e2d\uff0c\u8fd0\u884c\uff1a<\/p>\n

yum  install pwgen<\/pre>\n

\u5728\u57fa\u4e8e Arch \u7684\u7cfb\u7edf\u4e2d\uff0c\u5219\u8fd0\u884c\uff1a<\/p>\n

sudo pacman -S pwgen<\/pre>\n

pwgen \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4fbf\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u751f\u6210\u4e00\u4e2a\u957f\u5ea6\u4e3a 14 \u4e2a\u5b57\u7b26\u7684\u968f\u673a\u9ad8\u5f3a\u5ea6\u5bc6\u7801\uff1a<\/p>\n

pwgen 14 1<\/pre>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

Choo4aicozai3a<\/pre>\n

\"\"<\/p>\n

\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u751f\u6210\u4e00\u4e2a 14 \u4f4d\u5b57\u7b26\u957f\u7684\u5bc6\u7801\uff0c\u5982\u679c\u8981\u751f\u6210\u4e24\u4e2a\u4e0d\u540c\u7684 14 \u4f4d\u5b57\u7b26\u957f\u7684\u5bc6\u7801\uff0c\u5219\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n

pwgen 14  2<\/pre>\n
xee7seerez6Kau Aeshu0geveeji8<\/pre>\n

\u5982\u679c\u8981\u751f\u6210 100 \u4e2a\uff08\u5c3d\u7ba1\u53ef\u80fd\u6ca1\u6709\u5fc5\u8981\u751f\u6210\u90a3\u4e48\u591a\uff09\u4e0d\u540c\u7684 14 \u4f4d\u5b57\u7b26\u957f\u7684\u5bc6\u7801\uff0c\u5219\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n

pwgen 14<\/pre>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

pwgen 14 100<\/pre>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

kaeNg3EiVei4ei Oo0iehiJaix5Ae aenuv2eree2Quo iaT7zahH1eN2Aj Bie2owaiFahsie\r\ngaan9zu5Xeh5ah ahGeeth8ea5ooh Ir0ueda5poogh5 uo0ohqu2ufaiX2 Mei0pee6Og3zae\r\nOofeiceer8Aipu sheew3aeReidir Dee4Heib2eim2o eig6jar8giPhae Zahde9nae1Niew\r\nquatol5Oi3Bah2 quue4eebaiNgaa oGoahieSh5oL4m aequeeQue2piti laige5seePhugo\r\niiGo9Uthee4ros WievaiQu2xech6 shaeve0maaK3ae ool8Pai2eighis EPheiRiet1ohci\r\nZieX9outhoht8N Uh1UoPhah2Thee reaGhohZae5idi oiG4ooshiyi5in keePh1ohshei8y\r\naim5Eevah2thah Xaej8tha5eisho IeGie1Anaalaev gaoY3ohthooh3x chaebeesahTh8e\r\nsoh7oosieY5eiD ahmoh6Ihii6que Shoowoo5dahbah ieW0aiChubee7I Caet6aikai6aex\r\ncoo1du2Re9aika Ohnei5Egoh7leV aiyie6Ahdeipho EiV0aeToeth1da iNgaesu4eeyu0S\r\nEeb1suoV3naera railai2Vaina8u xu3OhVee1reeyu Og0eavae3oohoh audahneihaeK8a\r\nfoo6iechi5Eira oXeixoh6EwuboD we1eiDahNgoh9s ko1Eeju1iedu1z aeP7achiisohr7\r\nphang5caeGei5j ait4Shuo5Aitai no4eis9Tohd8oh Quiet6oTaaQuei Dei2pu2NaefeCa\r\nShiim9quiuy0ku yiewooph3thieL thu8Aphai1ieDa Phahnahch1Aam1 oocex7Yaith8oo\r\neraiGaech5ahNg neixa3malif5Ya Eux7chah8ahXix eex1lahXae4Mei uGhahzonu6airu\r\nyah8uWahn3jeiW Yi4ye4Choongie io1Vo3aiQuahpi rie4Rucheet6ae Dohbieyaeleis5\r\nxi1Zaushohbei7 jeeb9EiSiech0u eewo0Oow7ielie aiquooZamah5th kouj7Jaivohx9o\r\nbiyeeshesaDi9e she9ooj3zuw6Ah Eit7dei1Yei5la xohN0aeSheipaa Eeg9Phob6neema\r\neengoneo4saeL4 aeghi4feephu6W eiWash2Vie1mee chieceish5ioPe ool4Hongo7ef1o\r\njahBe1pui9thou eeV2choohoa4ee Ohmae0eef4ic8I Eet0deiyohdiew Ke9ue5thohzei3\r\naiyoxeiva8Maih gieRahgh8anahM ve2ath9Eyi5iet quohg6ok3Ahgee theingaech5Nef<\/pre>\n

\u5982\u679c\u8981\u5728\u5bc6\u7801\u4e2d\u5305\u542b\u81f3\u5c11 1 \u4e2a\u6570\u5b57\uff0c\u5219\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n

pwgen  14  1 -n  1<\/pre>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

xoiFush3ceiPhe<\/pre>\n

\u53e6\u5916\uff0cpwgen \u547d\u4ee4\u8fd8\u6709\u4e00\u4e9b\u5f88\u5b9e\u7528\u7684\u9009\u9879\uff1a<\/p>\n

-c \u6216 --capitalize \u5728\u5bc6\u7801\u4e2d\u5305\u542b\u81f3\u5c11\u4e00\u4e2a\u5927\u5199\u5b57\u6bcd\r\n-A \u6216 --no-capitalize \u5728\u5bc6\u7801\u4e2d\u4e0d\u5305\u542b\u5927\u5199\u5b57\u6bcd\r\n-n \u6216 --numerals \u5728\u5bc6\u7801\u4e2d\u5305\u542b\u81f3\u5c11\u4e00\u4e2a\u6570\u5b57\r\n-0 \u6216 --no-numerals \u5728\u5bc6\u7801\u4e2d\u4e0d\u5305\u542b\u6570\u5b57\r\n-y \u6216 --symbols \u5728\u5bc6\u7801\u4e2d\u5305\u542b\u81f3\u5c11\u4e00\u4e2a\u7279\u6b8a\u5b57\u7b26\r\n-s \u6216 --secure \u751f\u6210\u5b8c\u5168\u968f\u673a\u7684\u5bc6\u7801\r\n-B \u6216 --ambiguous \u5728\u5bc6\u7801\u4e2d\u4e0d\u5305\u542b\u96be\u4e8e\u533a\u5206\u7684\u5b57\u6bcd\uff0c\u5982 0 \u548c o\u30011 \u548c l\r\n-h \u6216 --help \u8f93\u51fa\u5e2e\u52a9\u4fe1\u606f\r\n-H \u6216 --sha1=path\/to\/file[#seed] \u4f7f\u7528\u67d0\u4e2a\u7ed9\u5b9a\u6587\u4ef6\u7684 sha1 \u54c8\u5e0c\u503c\u6765\u4f5c\u4e3a\u968f\u673a\u6570\u7684\u751f\u6210\u79cd\u5b50\r\n-C \u6309\u5217\u8f93\u51fa\u751f\u6210\u597d\u7684\u5bc6\u7801\r\n-1 \u4e0d\u6309\u5217\u8f93\u51fa\u751f\u6210\u597d\u7684\u5bc6\u7801\r\n-v \u6216 --no-vowels \u4e0d\u4f7f\u7528\u4efb\u4f55\u5143\u97f3\u5b57\u6bcd\uff0c\u4ee5\u9632\u6b62\u751f\u6210\u4e0b\u6d41\u7684\u8bcd\u8bed ```\r\n<\/pre>\n

\u82e5\u60f3\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u67e5\u9605\u5176\u8054\u673a\u624b\u518c\uff1a<\/p>\n

man pwgen\r\n<\/pre>\n
3. \u5728 Linux \u4e2d\u4f7f\u7528 GPG \u6765\u751f\u6210\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u5bc6\u7801<\/strong><\/div>\n

GPG (GnuPG \u6216 GNU Privacy Guard) \u662f\u4e00\u4e2a\u81ea\u7531\u5f00\u6e90\u7684\u547d\u4ee4\u884c\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u7528\u4e8e\u66ff\u4ee3\u8d5b\u95e8\u94c1\u514b\u7684 PGP \u52a0\u5bc6\u8f6f\u4ef6\u3002\u5728\u7c7b Unix \u64cd\u4f5c\u7cfb\u7edf\u3001Microsoft Windows \u548c Android \u4e2d\u90fd\u53ef\u4ee5\u83b7\u53d6\u5230\u5b83\u3002<\/p>\n

\u8981\u4f7f\u7528 PGP \u751f\u6210 1 \u4e2a\u957f\u5ea6\u4e3a 14 \u4e2a\u5b57\u7b26\u7684\u9ad8\u5f3a\u5ea6\u5bc6\u7801\uff0c\u8bf7\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

 gpg --gen-random --armor 1 14<\/pre>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

DkmsrUy3klzzbIbavx8=<\/pre>\n

\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u751f\u6210\u4e00\u4e2a\u5b89\u5168\u3001\u968f\u673a\u3001\u9ad8\u5f3a\u5ea6\u4e14\u57fa\u4e8e base64 \u7f16\u7801\u7684\u5bc6\u7801\u3002<\/p>\n

4. \u5728 Linux \u4e2d\u4f7f\u7528 Perl \u6765\u751f\u6210\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u5bc6\u7801<\/strong><\/div>\n

Perl \u5728\u5927\u591a\u6570 Linux \u53d1\u884c\u7248\u672c\u7684\u9ed8\u8ba4\u8f6f\u4ef6\u4ed3\u5e93\u4e2d\u90fd\u53ef\u4ee5\u83b7\u53d6\u5230\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u76f8\u5e94\u7684\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5\u5b83\u3002<\/p>\n

\u4f8b\u5982\u5728\u57fa\u4e8e DEB \u7684\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u5b89\u88c5 Perl\uff1a<\/p>\n

sudo apt-get install perl<\/pre>\n

\u5728\u57fa\u4e8e RPM \u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5 Perl\uff0c\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n

sudo yum install perl<\/pre>\n

\u5728\u57fa\u4e8e Arch \u7684\u7cfb\u7edf\u4e2d\uff0c\u5219\u8fd0\u884c\uff1a<\/p>\n

sudo pacman -S perl<\/pre>\n

\u4e00\u65e6 Perl \u5b89\u88c5\u5b8c\u6210\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\uff1a<\/p>\n

vi password.pl<\/pre>\n

\u63a5\u7740\u6dfb\u52a0\u4e0b\u9762\u7684\u5185\u5bb9\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d\uff1a<\/p>\n

#!\/usr\/bin\/perl\r\nmy @alphanumeric = ('a'..'z', 'A'..'Z', 0..9);\r\nmy $randpassword = join '', map $alphanumeric[rand @alphanumeric], 0..8;\r\nprint \"$randpassword\\n\"\r\n<\/pre>\n

\"\"<\/p>\n

\u4fdd\u5b58\u5e76\u5173\u95ed\u8be5\u6587\u4ef6\u3002<\/p>\n

\u63a5\u7740\uff0c\u5207\u6362\u5230\u4f60\u521a\u624d\u4fdd\u5b58\u6587\u4ef6\u7684\u5730\u65b9\uff0c\u5e76\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

perl password.pl<\/pre>\n

\u4f7f\u7528\u4f60\u81ea\u5df1\u5b9a\u4e49\u7684\u6587\u4ef6\u540d\u6765\u66ff\u6362\u4e0a\u9762\u547d\u4ee4\u4e2d\u7684\"password.pl\"\u3002<\/p>\n

\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n

3V4CJJnYd<\/pre>\n

\"\"<\/p>\n

ps\uff1a\u5b89\u5168\u662f\u4e00\u4e2a\u5927\u8bdd\u9898\uff0c\u5bf9\u4e8e\u751f\u6210\u7684\u5bc6\u7801\uff0c\u4f60\u5fc5\u987b\u8bb0\u4f4f\u5b83\uff0c\u53ef\u4ee5\u628a\u5b83\u4fdd\u5b58\u5230\u5b89\u5168\u7684\u5730\u65b9\u3002\u4e0d\u8981\u597d\u4e0d\u5bb9\u6613\u8bbe\u7f6e\u4e00\u4e2a\u5f3a\u5bc6\u7801\u7136\u540e\u7528\u4fbf\u5229\u8d34\u8d34\u5728\u5c4f\u5e55\u4e0a\u9762\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.ostechnix.com\/author\/sk\/<\/a><\/p>\n

\u8f6c\u8f7d\u5730\u5740\uff1ahttps:\/\/linux.cn\/article-8056-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/passwd-strong-four-methods.html<\/a>\u7f16\u8f91\uff1a\u9676\u6b66\u6770\uff0c\u5ba1\u6838\u5458\uff1a\u82cf\u897f\u4e91<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u5b89\u5168\u662f\u4e00\u4e2a\u5927\u7684\u8bdd\u9898\uff0c\u7ed9\u670d\u52a1\u5668\u8bbe\u7f6e\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u7684\u5bc6\u7801\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f60\u53ef\u80fd\u4f1a\u7591\u60d1\u4e00\u4e2a\u9ad8\u5f3a\u5ea6\u7684\u5bc6\u7801\u7a76\u7adf\u662f\u4ec0\u4e48\u6837\u7684 […]<\/p>\n","protected":false},"author":63,"featured_media":45048,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-45042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/45042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=45042"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/45042\/revisions"}],"predecessor-version":[{"id":268687,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/45042\/revisions\/268687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/45048"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=45042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=45042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=45042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}