{"id":50809,"date":"2023-10-31T22:38:06","date_gmt":"2023-10-31T14:38:06","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=50809"},"modified":"2023-10-31T22:38:06","modified_gmt":"2023-10-31T14:38:06","slug":"sudo-password-insults","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/sudo-password-insults.html","title":{"rendered":"\u81ea\u5b9a\u4e49 sudo \u5728\u4f60\u8f93\u5165\u9519\u8bef\u7684\u5bc6\u7801\u65f6\u5632\u8bbd\u4fe1\u606f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nsudoers \u662f Linux \u4e2d\u7684\u9ed8\u8ba4 sudo \u5b89\u5168\u7b56\u7565\u63d2\u4ef6\uff0c\u4f46\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5b89\u5168\u7b56\u7565\u4ee5\u53ca\u8f93\u5165\u8f93\u51fa\u65e5\u5fd7\u8bb0\u5f55\u7684\u63d2\u4ef6\u3002\u5b83\u7531 \/etc\/sudoers<\/span>\u8fd9\u4e2a\u6587\u4ef6\u9a71\u52a8\uff0c\u6216\u8005\u4e5f\u53ef\u5728 LDAP \u4e2d\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4f60\u53ef\u4ee5\u5728\u4e0a\u9762\u7684\u6587\u4ef6\u4e2d\u5b9a\u4e49 sudoers<\/strong> \u5632\u8bbd\u6216\u5176\u4ed6\u9009\u9879\u3002\u5b83\u5728 defaults<\/span> \u90e8\u5206\u4e0b\u8bbe\u7f6e\u3002<\/p>\n

\"\u8ba9<\/p>\n

\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u89e3\u91ca\u4e00\u4e2a sudoers \u914d\u7f6e\u53c2\u6570\uff0c\u4ee5\u5141\u8bb8\u4e2a\u4eba\u6216\u7cfb\u7edf\u7ba1\u7406\u5458\u8bbe\u7f6e sudo \u547d\u4ee4\uff0c\u5f53\u7cfb\u7edf\u7528\u6237\u8f93\u5165\u9519\u8bef\u5bc6\u7801\u65f6\u201c\u5632\u8bbd\u201d\u4ed6\u4eec\u3002<\/p>\n

\u9996\u5148\u6253\u5f00\u6587\u4ef6\/etc\/sudoers<\/span> \uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

$ sudo visudo\r\n<\/pre>\n

\u8fdb\u5165 defaults<\/span> \u90e8\u5206\uff0c\u5e76\u6dfb\u52a0\u4e0b\u9762\u7684\u884c\uff1a<\/p>\n

Defaults   insults\r\n<\/pre>\n

\u4e0b\u9762\u662f\u6211\u7cfb\u7edf\u4e2d \/etc\/sudoers<\/span> \u9ed8\u8ba4\u5c55\u793a\u7684 defaults<\/span> \u90e8\u5206\u3002<\/p>\n

\"\u8ba9<\/p>\n

\u8bbe\u7f6e sudo insults \u53c2\u6570<\/em><\/p>\n

\u4ece\u4e0a\u9762\u7684\u622a\u56fe\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230 defaults<\/span> \u4e2d\u8fd8\u6709\u8bb8\u591a\u5176\u4ed6\u9ed8\u8ba4\u503c\u5b9a\u4e49\uff0c\u4f8b\u5982\uff0c\u6bcf\u6b21\u7528\u6237\u8f93\u5165\u9519\u8bef\u7684\u5bc6\u7801\u65f6\u53d1\u9001\u90ae\u4ef6\u5230 root\u3001\u8bbe\u7f6e\u5b89\u5168\u8def\u5f84\u3001\u914d\u7f6e\u81ea\u5b9a\u4e49 sudo \u65e5\u5fd7\u6587\u4ef6\u7b49\u3002<\/p>\n

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

\u8fd0\u884c sudo<\/span> \u547d\u4ee4\u5e76\u8f93\u5165\u9519\u8bef\u7684\u5bc6\u7801\uff0c\u7136\u540e\u89c2\u5bdf insults \u9009\u9879\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1a<\/p>\n

$ sudo visudo\r\n<\/pre>\n

\"\u8ba9<\/p>\n

\u5b9e\u8df5 sudo insult<\/em><\/p>\n

\u6ce8\u610f<\/strong>\uff1a\u5f53\u914d\u7f6e insults \u53c2\u6570\u65f6\uff0c\u5b83\u4f1a\u7981\u7528 badpass_message<\/span> \u53c2\u6570\uff0c\u8be5\u53c2\u6570\u5728\u7528\u6237\u8f93\u5165\u9519\u8bef\u7684\u5bc6\u7801\u65f6\uff0c\u4f1a\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u51fa\u7279\u5b9a\u7684\u6d88\u606f\uff08\u9ed8\u8ba4\u6d88\u606f\u4e3a \u201csorry, try again<\/strong>\u201d\uff09\u3002<\/p>\n

\u8981\u4fee\u6539\u8be5\u6d88\u606f\uff0c\u8bf7\u5c06badpass_message<\/span> \u53c2\u6570\u6dfb\u52a0\u5230 \/etc\/sudoers<\/span> \u6587\u4ef6\u4e2d\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

Defaults  badpass_message=\"Password is wrong, please try again\"  #try to set a message of your own\r\n<\/pre>\n

\"\u8ba9<\/p>\n

\u8bbe\u7f6e sudo \u9519\u8bef\u5bc6\u7801\u6d88\u606f<\/em><\/p>\n

\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\uff0c\u7136\u540e\u8c03\u7528sudo<\/span> \u67e5\u770b\u5b83\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff0c\u4f60\u8bbe\u7f6e\u7684 badpass_message<\/span> \u6d88\u606f\u4f1a\u5728\u6bcf\u6b21\u4f60\u6216\u4efb\u4f55\u7cfb\u7edf\u7528\u6237\u8f93\u5165\u9519\u8bef\u7684\u5bc6\u7801\u7684\u65f6\u5019\u6253\u5370\u51fa\u6765\u3002<\/p>\n

$ sudo visudo\r\n<\/pre>\n

\"\u8ba9<\/p>\n

sudo \u5bc6\u7801\u9519\u8bef\u6d88\u606f<\/em><\/p>\n

\u5c31\u662f\u8fd9\u6837\u4e86\uff0c\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u56de\u987e\u4e86\u5982\u4f55\u5728\u7528\u6237\u8f93\u5165\u9519\u8bef\u7684\u5bc6\u7801\u65f6\u5c06 sudo<\/span> \u8bbe\u7f6e\u4e3a\u663e\u793a\u5632\u8bbd\u3002\u8bf7\u901a\u8fc7\u4e0b\u9762\u7684\u8bc4\u8bba\u680f\u5206\u4eab\u4f60\u7684\u60f3\u6cd5\u3002<\/p>\n


\n

\u4f5c\u8005\u7b80\u4ecb\uff1a<\/p>\n

\"\u8ba9<\/p>\n

Aaron Kili \u662f Linux \u548c F.O.S.S \u7231\u597d\u8005\uff0c\u5c06\u6765\u7684 Linux SysAdmin\u3001web \u5f00\u53d1\u4eba\u5458\uff0c\u76ee\u524d\u662f TecMint \u7684\u5185\u5bb9\u521b\u5efa\u8005\uff0c\u4ed6\u559c\u6b22\u7528\u7535\u8111\u5de5\u4f5c\uff0c\u5e76\u575a\u4fe1\u5206\u4eab\u77e5\u8bc6\u3002<\/p>\n

 <\/p>\n


\n

via: http:\/\/www.tecmint.com\/sudo-insult-when-enter-wrong-password\/<\/p>\n

\u4f5c\u8005\uff1aAaron Kili \u8bd1\u8005\uff1ageekpi \u6821\u5bf9\uff1ajasminepeng<\/p>\n

\u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8128-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/sudo-password-insults.html<\/a>\u7f16\u8f91\u5458\uff1a\u5f20\u96c4\uff0c\u5ba1\u6838\u5458\uff1a\u738b\u6bc5<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

sudoers \u662f Linux \u4e2d\u7684\u9ed8\u8ba4 sudo \u5b89\u5168\u7b56\u7565\u63d2\u4ef6\uff0c\u4f46\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5b89\u5168\u7b56\u7565\u4ee5\u53ca\u8f93\u5165\u8f93\u51fa\u65e5\u5fd7\u8bb0\u5f55\u7684\u63d2\u4ef6\u3002\u5b83\u7531 \/etc\/sudoers \u8fd9\u4e2a\u6587\u4ef6\u9a71\u52a8\uff0c\u6216\u8005\u4e5f\u53ef\u5728 LDAP \u4e2d\u3002<\/p>\n","protected":false},"author":643,"featured_media":81858,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-50809","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\/50809","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\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=50809"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/50809\/revisions"}],"predecessor-version":[{"id":81916,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/50809\/revisions\/81916"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/81858"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=50809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=50809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=50809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}