{"id":167205,"date":"2019-12-30T08:32:25","date_gmt":"2019-12-30T00:32:25","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=167205"},"modified":"2019-12-18T14:33:25","modified_gmt":"2019-12-18T06:33:25","slug":"linux-ssh-2","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-ssh-2.html","title":{"rendered":"Linux\u66f4\u6539SSH\u8fdc\u7a0b\u767b\u5f55\u7aef\u53e3\u6559\u7a0b"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nSSH\uff1a\u77ed\u4e8e\u5b89\u5168Shell\uff0cSSH\uff08\u7531SSH\u901a\u4fe1\u5b89\u5168\u516c\u53f8\u5f00\u53d1\uff09\u662f\u7528\u4e8e\u8fdc\u7a0b\u767b\u5f55\u5b89\u5168\u534f\u8bae\u3002 \u4f7f\u7528SSH\u5ba2\u6237\u7aef\uff0c\u7528\u6237\u53ef\u4ee5\u8fde\u63a5\u5230\u670d\u52a1\u5668\u4ee5\u6bd4\u5176\u4ed6\u65b9\u6cd5\uff08\u4f8b\u5982telnet\uff09\u66f4\u5b89\u5168\u7684\u65b9\u5f0f\u4f20\u8f93\u4fe1\u606f\u3002\u5230\u53f3\u4fa7\u7684\u56fe\u50cf\u662fSSH\u4f1a\u8bdd\uff0c\u5b83\u4f7f\u7528\u4e00\u4e2a\u547d\u4ee4\u884c\u754c\u9762\uff0c\u53ef\u5982\u4f55\u5916\u89c2\u7684\u793a\u4f8b\u3002 SSH\u9ed8\u8ba4\u4e3a\u7aef\u53e322\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4e3a\u4e86\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u5b89\u5168\u6027\uff0c\u60a8\u5e94\u8be5\u66f4\u6539\u670d\u52a1\u5668\u4e0a\u7684SSH\u767b\u5f55\u7aef\u53e3\uff0c\u800c\u4e0d\u8981\u4f7f\u7528\u9ed8\u8ba4\u7aef\u53e322\u3002\u5982\u4f55\u5728Linux\u4e2d\u66f4\u6539SSH\u8fdc\u7a0b\u767b\u5f55\u7aef\u53e3\u3002<\/p>\n

1.\u7f16\u8f91sshd_config\u6587\u4ef6<\/strong><\/span><\/div>\n
nano \/etc\/ssh\/sshd_config<\/pre>\n

\u641c\u7d22 #Port 22\u884c\uff0c\u5220\u9664\u5f00\u5934\u7684 # \u5b57\u7b26\uff0c\u7136\u540e\u5c06\u5176\u66ff\u6362\u4e3a\u8981\u4f7f\u7528\u7684\u7aef\u53e3\uff0c\u4f8b\u59822404\u3002\u8bf7\u786e\u4fdd\u8be5\u7aef\u53e32404\u4e0a\u6ca1\u6709\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u3002<\/p>\n

2.\u91cd\u65b0\u542f\u52a8sshd\u670d\u52a1<\/strong><\/span><\/div>\n
service sshd restart<\/pre>\n
3. [\u9009\u9879]\u5982\u679c\u60a8\u6b63\u5728\u4f7f\u7528\u50cfiptables\u8fd9\u6837\u7684\u9632\u706b\u5899\uff0c\u5219\u9700\u8981\u6253\u5f00\u7aef\u53e32404\u3002<\/strong><\/span><\/div>\n
service iptables stop\r\n\r\niptables -A INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 2404 -j ACCEPT\r\n\r\nservice iptables save\r\n\r\nservice iptables start<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u4e3a\u4e86\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u5b89\u5168\u6027\uff0c\u60a8\u5e94\u8be5\u66f4\u6539\u670d\u52a1\u5668\u4e0a\u7684SSH\u767b\u5f55\u7aef\u53e3\uff0c\u800c\u4e0d\u8981\u4f7f\u7528\u9ed8\u8ba4\u7aef\u53e322\u3002\u5982\u4f55\u5728Linux\u4e2d\u66f4\u6539SS […]<\/p>\n","protected":false},"author":63,"featured_media":167206,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-167205","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\/167205","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=167205"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/167205\/revisions"}],"predecessor-version":[{"id":167325,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/167205\/revisions\/167325"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/167206"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=167205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=167205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=167205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}