{"id":228658,"date":"2021-11-01T08:54:08","date_gmt":"2021-11-01T00:54:08","guid":{"rendered":"https:\/\/gulass.cn\/?p=228658"},"modified":"2021-10-20T16:55:38","modified_gmt":"2021-10-20T08:55:38","slug":"generate-strong-password-and-check","status":"publish","type":"post","link":"https:\/\/gulass.cn\/generate-strong-password-and-check.html","title":{"rendered":"\u5982\u4f55\u5728 Linux \u751f\u6210\u590d\u6742\u5bc6\u7801\u5e76\u4e14\u68c0\u67e5\u5bc6\u7801\u5f3a\u5ea6"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u8ba8\u8bba\u5982\u4f55\u751f\u6210\u590d\u6742\u5bc6\u7801\u5e76\u4e14\u68c0\u67e5\u5bc6\u7801\u5f3a\u5ea6\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u751f\u6210\u590d\u6742\u7684\u5bc6\u7801<\/strong><\/div>\n

\u5f3a\u5bc6\u7801\u5e94\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u7b26\u53f7\u7684\u6df7\u5408\u7ec4\u6210\u3002\u7b2c\u4e8c\u4e2a\u8981\u6c42\u662f\u4e0d\u8981\u4f7f\u7528\u5df2\u77e5\u5355\u8bcd\u3001\u51fa\u751f\u65e5\u671f\u6216\u59d3\u540d\uff0c\u56e0\u4e3a\u5f88\u5bb9\u6613\u53d7\u5230\u5b57\u5178\u653b\u51fb\u3002<\/p>\n

\u5bc6\u7801\u5e94\u8be5\u5305\u542b\u591a\u5c11\u4e2a\u5b57\u7b26\uff1f\u5b9e\u9645\u4e0a\u6ca1\u6709\u5177\u4f53\u7684\u7b54\u6848\uff0c\u4f46\u662f\u8d85\u8fc7 16 \u4e2a\u5b57\u7b26\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002\u56e0\u6b64\uff0c\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u5177\u6709 OpenSSL \u6216 GPG\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u6765\u5b8c\u6210\u751f\u6210\u5bc6\u7801\u7684\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u4e0b\u9762\u6211\u4eec\u4f7f\u7528GPG<\/code>\u751f\u6210\u5bc6\u7801\uff1a<\/p>\n

\r\n[root@localhost ~]# gpg --gen-random --armor 2 12\r\nzXVKRoB0\/V4BN9QG\r\n<\/pre>\n

\u5982\u679c\u4e0d\u60f3\u5e26\u6709\u7279\u6b8a\u5b57\u7b26\uff0c\u53ef\u4ee5\u4f7f\u7528sed<\/code>\u547d\u4ee4\u8fc7\u6ee4\u6389\uff1a<\/p>\n

\r\n[root@localhost ~]# gpg --gen-random --armor 2 12|sed 's\/[^a-zA-Z0-9]\/\/g'\r\nn4ciIlRLkLTkzwg\r\n<\/pre>\n

\u4e0a\u9762\u4f7f\u7528--gen-random<\/code>\u9009\u9879\u6765\u968f\u673a\u751f\u6210\u5b57\u7b26\u3002\u4f7f\u7528--armor<\/code>\u9009\u9879\u6765\u751f\u6210ASCII\u5b57\u7b26\u3002\u540e\u9762\u7684\u9009\u98792\u53ef\u4ee5\u4f7f[0][1][2]<\/code>\u4e09\u4e2a\u9009\u9879\uff0c\u4ed6\u8868\u793a\u8d28\u91cf\u7ea7\u522b\u3002\u6700\u540e\u4e00\u4e2a\u6570\u5b57\u4ee3\u8868\u5b57\u7b26\u957f\u5ea6\u3002<\/p>\n

\u76f8\u540c\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528OpenSSL<\/code>\u6765\u751f\u6210\u5bc6\u7801\uff1a<\/p>\n

\r\n[root@localhost ~]# openssl rand -base64 12\r\nQIrH\/PLXqzmLuI\/a\r\n<\/pre>\n

\u540c\u6837\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528sed<\/code>\u547d\u4ee4\u8fc7\u6ee4\u6389\u7279\u6b8a\u5b57\u7b26\uff1a<\/p>\n

\r\n[root@localhost ~]# openssl rand -base64 12| sed 's\/[^a-zA-Z0-9]\/\/g'\r\nlXIg4cKLCLVvsi\r\n<\/pre>\n
\u68c0\u67e5\u5bc6\u7801\u5f3a\u5ea6<\/strong><\/div>\n

\u73b0\u5728\u6211\u4eec\u6709\u4e86\u5bc6\u7801\uff0c\u662f\u65f6\u5019\u770b\u770b\u5b83\u662f\u5426\u901a\u8fc7\u4e86\u6d4b\u8bd5\uff1a\u60a8\u7684\u5bc6\u7801\u662f\u5426\u8db3\u591f\u5f3a\u5927\uff1f\u4e3a\u4e86\u786e\u5b9a\u5bc6\u7801\u662f\u5426\u8db3\u591f\u5f3a\u5927\uff0c\u6211\u4eec\u5c06\u5728Centos8\u4e2d\u5b89\u88c5\u4f7f\u7528cracklib<\/code>\u5de5\u5177\u3002<\/p>\n

\r\n[root@localhost ~]# yum -y install cracklib\r\n<\/pre>\n

\u4e0b\u9762\u6211\u4eec\u5148\u6d4b\u8bd5\u4e00\u4e2a\u7b80\u5355\u7684\u5bc6\u7801\uff1a<\/p>\n

\r\n[root@localhost ~]# echo \"a1b2c5\" | cracklib-check \r\na1b2c5: it is based on a dictionary word\r\n<\/pre>\n

\"\"
\n\u5982\u679c\u4f7f\u7528\u666e\u901a\u5355\u8bcd\u5462\uff1f<\/p>\n

\r\n[root@localhost ~]# echo \"Administrator\"|cracklib-check \r\nAdministrator: it is based on a dictionary word\r\n<\/pre>\n

\"\"
\n\u4e0a\u9762\u4e24\u4e2a\u5bc6\u7801\u7684\u8f93\u51fa\uff0c\u540c\u6837\u63d0\u793a\u5728\u8bcd\u5178\u4e2d\u80fd\u67e5\u627e\u5230\u3002<\/p>\n

\u4e0b\u9762\u6211\u4eec\u6d4b\u8bd5\u4e00\u4e2a\u751f\u6210\u7684\u5bc6\u7801\u770b\u4e00\u4e0b\u5f3a\u5ea6\u5982\u4f55\uff1a<\/p>\n

\r\n[root@localhost ~]# openssl rand -base64 12 | cracklib-check \r\nVdBlmvIgGY4ehWly: OK\r\n<\/pre>\n

\u53ef\u4ee5\u770b\u5230\u5bc6\u7801\u6ca1\u95ee\u9898\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5df2\u7ecf\u770b\u5230\u751f\u6210\u548c\u9a8c\u8bc1\u5bc6\u7801\u662f\u591a\u4e48\u5bb9\u6613\uff0c\u4f46\u4e0d\u8981\u5fd8\u8bb0\u4e3a\u6bcf\u4e2a\u670d\u52a1\u751f\u6210\u4e0d\u540c\u7684\u5bc6\u7801\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5f3a\u5bc6\u7801\u5e94\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u7b26\u53f7\u7684\u6df7\u5408\u7ec4\u6210\u3002\u7b2c\u4e8c\u4e2a\u8981\u6c42\u662f\u4e0d\u8981\u4f7f\u7528\u5df2\u77e5\u5355\u8bcd\u3001\u51fa\u751f\u65e5\u671f\u6216\u59d3\u540d\uff0c\u56e0\u4e3a\u5f88\u5bb9\u6613\u53d7\u5230\u5b57\u5178\u653b\u51fb\u3002 […]<\/p>\n","protected":false},"author":309,"featured_media":228659,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-228658","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/228658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=228658"}],"version-history":[{"count":1,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/228658\/revisions"}],"predecessor-version":[{"id":228662,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/228658\/revisions\/228662"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/228659"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=228658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=228658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=228658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}