{"id":8673,"date":"2020-09-22T17:29:16","date_gmt":"2020-09-22T09:29:16","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=8673"},"modified":"2020-09-22T22:07:53","modified_gmt":"2020-09-22T14:07:53","slug":"mkpasswd","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/mkpasswd","title":{"rendered":"mkpasswd\u547d\u4ee4 – \u751f\u6210\u7528\u4e8e\u7528\u6237\u7684\u65b0\u5bc6\u7801"},"content":{"rendered":"\n

mkpasswd\u662fmake password\u7684\u7b80\u5199\u3002mkpasswd\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u53ef\u4ee5\u751f\u6210\u5e94\u7528\u7528\u6237\u7684\u65b0\u5bc6\u7801\uff0c\u9009\u62e9\u5c06\u5176\u5e94\u7528\u4e8e\u7528\u6237\u3002<\/p>\n\n\n\n

mkpasswd\u547d\u4ee4\u4f7f\u7528\u524d\u9700\u8981\u5b89\u88c5expect\u5305\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>mkpasswd [\u53c2\u6570] [\u7528\u6237]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-c<\/td>\u5b9a\u4e49\u5728\u5bc6\u7801\u4e2d\u5c0f\u5199\u5b57\u6bcd\u5b57\u7b26\u7684\u6700\u5c0f\u6570\u76ee\uff0c\u9ed8\u8ba4\u503c\u662f2<\/td><\/tr>
-C<\/td>\u5b9a\u4e49\u5728\u5bc6\u7801\u4e2d\u5927\u5199\u5b57\u6bcd\u5b57\u7b26\u7684\u6700\u5c0f\u6570\u76ee\uff0c\u9ed8\u8ba4\u503c\u662f2<\/td><\/tr>
-s<\/td>\u5b9a\u4e49\u5728\u5bc6\u7801\u4e2d\u7279\u6b8a\u5b57\u7b26\u7684\u6700\u5c0f\u6570\u76ee\uff0c\u9ed8\u8ba4\u503c\u662f1<\/td><\/tr>
-p<\/td>\u6307\u5b9a\u7a0b\u5e8f\u6765\u8bbe\u7f6e\u5bc6\u7801\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u5b58\u5728\u4f7f\u7528\/etc\/yppasswd\uff0c\u5426\u5219\u4f7f\u7528\/bin\/passwd<\/td><\/tr>
-d<\/td>\u5b9a\u4e49\u5bc6\u7801\u7684\u6700\u5c0f\u6570\u76ee\uff0c\u9ed8\u8ba4\u503c\u662f2<\/td><\/tr>
-l<\/td>\u5b9a\u4e49\u53e3\u4ee4\u7684\u957f\u5ea6\uff0c\u9ed8\u8ba4\u503c\u4e3a9<\/td><\/tr>
-v<\/td>\u5bfc\u81f4\u5bc6\u7801\u8bbe\u7f6e\u4e92\u52a8\u53ef\u89c1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u751f\u6210\u968f\u673a\u5bc6\u7801\u540c\u65f6\u5236\u5b9a\u957f\u5ea6\u4e3a20\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mkpasswd -l 20<\/pre>\n\n\n\n

\u751f\u6210\u6307\u5b9a\u6570\u5b57\u4f4d\u6570\u7684\u5bc6\u7801\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mkpasswd -d 3<\/pre>\n\n\n\n

\u4e3a\u7528\u6237\u66f4\u6539\u968f\u673a\u5bc6\u7801\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# echo mkpasswd -l 10<\/code> | passwd --stdin xiaoming<\/pre>\n","protected":false},"excerpt":{"rendered":"

mkpasswd\u662fmake password\u7684\u7b80\u5199\u3002mkpasswd\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u53ef\u4ee5\u751f\u6210\u5e94\u7528\u7528\u6237\u7684\u65b0\u5bc6\u7801\uff0c\u9009\u62e9 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8673"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=8673"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8673\/revisions"}],"predecessor-version":[{"id":8697,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8673\/revisions\/8697"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=8673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=8673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=8673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}