\u4e00\u4e2a\u65e5\u5fd7\u5206\u6790\u7684\u5b9e\u4f8b<\/strong><\/div>\n\u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5b83\u5c06\u901a\u8fc7 auth.log \u6587\u4ef6\u641c\u7d22\u767b\u5f55\u5c1d\u8bd5\u5931\u8d25\u7684\u8bc1\u636e\u3002\u641c\u7d22\u5355\u8bcd failure \u5c06\u8fd4\u56de\u5305\u542b\u77ed\u8bed authentication failure \u7684\u6240\u6709\u884c<\/p>\n
\u5076\u5c14\u68c0\u67e5\u4e00\u4e0b\u53ef\u4ee5\u5e2e\u52a9\u60a8\u53d1\u73b0\u901a\u8fc7\u731c\u6d4b\u6b63\u786e\u5bc6\u7801\u6765\u767b\u5f55\u4f60\u7684Linux\u7cfb\u7edf\u7684\u4f01\u56fe\u3002\u7ba1\u7406\u5458\u53ef\u80fd\u5c06\u5bc6\u7801\u8f93\u9519\u4e00\u4e24\u6b21\uff0c\u4f46\u592a\u591a\u6b21\u7684\u5bc6\u7801\u8f93\u5165\u9519\u8bef\u5c31\u9700\u8981\u8b66\u60d5\u8d77\u6765\uff1a<\/p>\n
\r\n\u60a8\u53ef\u4ee5\u67e5\u770b\u4ed6\u4eec\u7684\u5185\u5bb9\u4ee5\u4e86\u89e3\u4ed6\u4eec\u5bf9\u65e5\u5fd7\u8f6e\u6362\u7684\u914d\u7f6e\u3002\r\n\r\n\u5982\u4f55\u8bfb\u53d6\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\r\n\u5e94\u8be5\u5b8c\u5168\u907f\u514d\u4f7f\u7528 cat \u3002\u5b83\u53ea\u4f1a\u5728\u60a8\u7684\u5c4f\u5e55\u4e0a\u663e\u793a\u6570\u5343\u884c\u5185\u5bb9\u3002\r\n\r\n\u6211\u5efa\u8bae\u4f7f\u7528 grep \u8fc7\u6ee4\u6587\u4ef6\u4e2d\u7684\u6587\u672c\u3002\r\n\r\n\u4f7f\u7528 tail -f \u547d\u4ee4\u53ef\u4ee5\u5b9e\u65f6\u8bfb\u53d6\u5f53\u524d\u65e5\u5fd7\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u5c06\u5176\u4e0e grep \u7ed3\u5408\u4f7f\u7528\u4ee5\u8fc7\u6ee4\u6240\u9700\u7684\u6587\u672c\u3002\r\n\r\n\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u8bbf\u95ee\u65e7\u7684\u538b\u7f29\u65e5\u5fd7\u3002\u60a8\u53ef\u80fd\u603b\u662f\u5148\u89e3\u538b\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528 grep\u3001less \u548c\u5176\u4ed6\u547d\u4ee4\u6765\u8bfb\u53d6\u5176\u5185\u5bb9\uff0c\u4f46\u662f\uff0c\u6709\u66f4\u597d\u7684\u9009\u62e9\u3002\u6709 zcat\u3001zless \u7b49 z \u547d\u4ee4\u53ef\u8ba9\u60a8\u5904\u7406\u538b\u7f29\u6587\u4ef6\u800c\u65e0\u9700\u5148\u89e3\u538b\u5b83\u4eec\u3002\r\n\r\n\u4e00\u4e2a\u65e5\u5fd7\u5206\u6790\u7684\u5b9e\u4f8b\r\n\u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5b83\u5c06\u901a\u8fc7 auth.log \u6587\u4ef6\u641c\u7d22\u767b\u5f55\u5c1d\u8bd5\u5931\u8d25\u7684\u8bc1\u636e\u3002\u641c\u7d22\u5355\u8bcd failure \u5c06\u8fd4\u56de\u5305\u542b\u77ed\u8bed authentication failure \u7684\u6240\u6709\u884c\r\n\r\n\u5076\u5c14\u68c0\u67e5\u4e00\u4e0b\u53ef\u4ee5\u5e2e\u52a9\u60a8\u53d1\u73b0\u901a\u8fc7\u731c\u6d4b\u6b63\u786e\u5bc6\u7801\u6765\u767b\u5f55\u4f60\u7684Linux\u7cfb\u7edf\u7684\u4f01\u56fe\u3002\u7ba1\u7406\u5458\u53ef\u80fd\u5c06\u5bc6\u7801\u8f93\u9519\u4e00\u4e24\u6b21\uff0c\u4f46\u592a\u591a\u6b21\u7684\u5bc6\u7801\u8f93\u5165\u9519\u8bef\u5c31\u9700\u8981\u8b66\u60d5\u8d77\u6765\uff1a<\/pre>\n\u5982\u60a8\u6240\u77e5\uff0cgrep \u4e3a\u60a8\u5b8c\u6210\u4e86\u8fd9\u9879\u5de5\u4f5c\uff0c\u4f46\u60a8\u4ece\u7ed3\u679c\u4e2d\u53ea\u80fd\u770b\u5230\u8eab\u4efd\u9a8c\u8bc1\u5931\u8d25\u3002\u8981\u662f\u80fd\u77e5\u9053\u6d89\u53ca\u8c01\u7684\u5e10\u6237\u4f1a\u66f4\u6709\u7528\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u544a\u8bc9\u5b83\u5305\u542b\u5339\u914d\u4e4b\u524d\u548c\u4e4b\u540e\u7684\u884c\u6765\u6269\u5c55 grep \u8fd4\u56de\u7684\u7ed3\u679c\u3002<\/p>\n
\u6b64\u793a\u4f8b\u6253\u5370\u5339\u914d\u53ca\u5176\u4e4b\u524d\u548c\u4e4b\u540e\u76841\u884c\u3002\u5b83\u544a\u8bc9\u4f60\u6709\u4eba\u4f7f\u7528\u5e10\u6237 ubuntu \u5c1d\u8bd5\u4f7f\u7528 su\uff08\u5207\u6362\u7528\u6237\uff09\u767b\u5f55 root \u5e10\u6237\u5931\u8d25\uff1a<\/p>\n
\r\n$ cat \/var\/log\/auth.log | grep -C1 failure\r\n\r\nSep 4 22:43:43 hongdaokeji su: pam_unix(su:auth): Couldn't open \/etc\/securetty: No such file or directory\r\nSep 4 22:43:43 hongdaokeji su: pam_unix(su:auth): authentication failure; logname=ubuntu uid=1000 euid=0 tty=pts\/2 ruser=ubuntu rhost= user=root\r\nSep 4 22:43:46 hongdaokeji su: FAILED SU (to root) ubuntu on pts\/2<\/pre>\n","protected":false},"excerpt":{"rendered":"Syslogd \u5c06\u6536\u96c6\u7cfb\u7edf\u8fdb\u7a0b\u548c\u5e94\u7528\u7a0b\u5e8f\u53d1\u9001\u5230 \/dev\/log \u7684\u65e5\u5fd7\u6d88\u606f\u3002\u7136\u540e\u5b83\u5c06\u6d88\u606f\u5b9a\u5411\u5230 \/var\/l […]<\/p>\n","protected":false},"author":317,"featured_media":242930,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-252118","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\/252118","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\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=252118"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/252118\/revisions"}],"predecessor-version":[{"id":252121,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/252118\/revisions\/252121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/242930"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=252118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=252118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=252118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}