{"id":49,"date":"2006-12-24T17:22:03","date_gmt":"2006-12-24T09:22:03","guid":{"rendered":"http:\/\/twycf.com\/wordpress\/archives\/49"},"modified":"2006-12-24T17:24:54","modified_gmt":"2006-12-24T09:24:54","slug":"ssh-allow-with-tcp_wrappers","status":"publish","type":"post","link":"https:\/\/twycf.com\/?p=49","title":{"rendered":"SSH Allow with tcp_wrappers"},"content":{"rendered":"<p>\u5e38\u770b\u7cfb\u7d71 log \u6642\u6703\u767c\u73fe\uff0c \/var\/log\/auth.log \u5e38\u5e38\u6703\u6709\u7121\u804a\u7684\u4eba\u5728 Try SSH \u7cfb\u7d71\u5e33\u865f\/\u5bc6\u78bc\uff0c\u6b64\u6642\u6700\u597d\u7684\u9632\u8b77\u65b9\u5f0f\u5c31\u662f\u8b93\u7121\u804a\u7684\u4eba\u9023 Try \u7684\u6a5f\u6703\u4e5f\u6c92\u6709\uff0c\u9019\u6642\u8981\u642d\u914d tcp_wrappers\u3002<!--more--><\/p>\n<p>\u5728 \/etc\/hosts.allow \u524d\u9762\u52a0\u5165\uff1a<br \/>\n<coolcode linenum=\"off\">sshd : ALL except \\<br \/>\n192.168.1.0\/255.255.255.0 222.111.222.111\/255.255.255.255 : \\<br \/>\nspawn=(echo `date` &#8211; %u@%h[%a] %d|\/usr\/bin\/mail -s &#8220;tcp_wrappers&#8221; root) &#038; : deny<\/coolcode><\/p>\n<p>222.111.222.111 \u6307\u7684\u662f\u7279\u5b9a\u5141\u8a31\u4f7f\u7528 ssh \u9032\u4e3b\u6a5f\u7684IP\uff0c\u7576\u7136\u9084\u53ef\u4ee5\u52a0\u5165\u66f4\u591a\u5141\u8a31\u7684\u7ba1\u7406\u4e3b\u6a5fIP\uff0c\u5169\u7d44 IP \u9593\u8981\u7559\u4e00\u500b\u7a7a\u683c\u505a\u5206\u9694 (\u5982 111.222.333.444 111.222.333.445 111.222.333.446)\u3002192.168.1.0\/255.255.255.0 \u6307\u7684\u662f\u5141\u8a31\u5167\u90e8\u5b50\u7db2\u57df\u5167\u96fb\u8166 IP \u5168\u90e8\u958b\u653e\u53ef\u4ee5\u9032\u5165\u4e3b\u6a5f\uff0c\u5f8c\u9762\u7684\u7db2\u8def\u906e\u7f69 \/255.255.255.0 \u4e5f\u5225\u5fd8\u4e86\u7167\u81ea\u5df1\u7684\u8a2d\u5b9a\u4fee\u6539\u3002<br \/>\n\u5982\u6b64\u7684\u8a2d\u5b9a\u9664\u4e86\u5141\u8a31\u7684 IP \u53ef\u4ee5\u9032\u5165\u4e3b\u6a5f\u5916\uff0c\u5176\u4ed6\u7684 IP \u53ea\u8981\u5617\u8a66\u9032\u5165\u90fd\u6703\u88ab\u62d2\u7d55\uff0c\u4e14\u7cfb\u7d71\u6703\u81ea\u52d5\u767c\u4e00\u5c01\u4fe1\u7d66 root\uff0c\u4e5f\u4fdd\u969c\u7cfb\u7d71\u5e33\u865f\u4e0d\u6703\u88ab Bruteforce\u3002  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e38\u770b\u7cfb\u7d71 log \u6642\u6703\u767c\u73fe\uff0c \/var\/log\/auth.log \u5e38\u5e38\u6703\u6709\u7121\u804a\u7684\u4eba\u5728 Try SSH \u7cfb\u7d71\u5e33\u865f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-freebsd"],"_links":{"self":[{"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49"}],"version-history":[{"count":0,"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions"}],"wp:attachment":[{"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}