{"id":85732,"date":"2023-12-24T05:25:27","date_gmt":"2023-12-23T21:25:27","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=85732"},"modified":"2023-12-24T05:25:27","modified_gmt":"2023-12-23T21:25:27","slug":"centos-ssh-ip-user","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos-ssh-ip-user.html","title":{"rendered":"CentOS \u4e0bSSH\u9650\u5236IP\u548c\u7528\u6237\u767b\u5f55"},"content":{"rendered":"

CentOS \u4e0b\u8bbe\u7f6eSSH\u53ea\u5141\u8bb8\u7279\u5b9a\u7528\u6237\u4ece\u7279\u5b9a\u7684IP\u767b\u5f55\uff0c\u5176\u5b83\u672a\u7ecf\u5141\u8bb8\u7684\u7528\u6237\u548cIP\u90fd\u4e0d\u80fd\u767b\u5f55\u3002<\/p>\n

\u6f14\u793a\u73af\u5883<\/strong><\/div>\n

192.168.1.81\uff1aCentOS 6<\/p>\n

192.168.0.222\uff1aWin 10<\/p>\n

192.168.1.135\uff1aWin 8.1<\/p><\/blockquote>\n

\u672a\u505a\u4efb\u4f55\u8bbe\u7f6e\u65f6192.168.0.222\u548c192.168.1.135\u90fd\u80fd\u767b\u5f55192.168.1.81\u3002
\n192.168.0.222<\/span>
\n\"\"
\n192.168.1.135<\/span>
\n\"\"<\/p>\n

\u793a\u4f8b1\uff1a\u53ea\u5141\u8bb8192.168.0.222\u767b\u5f55192.168.1.81<\/strong><\/div>\n

# vim \/etc\/hosts.allow<\/span>\u6700\u540e\u4e00\u884c\u52a0\u5165\uff1a
\nsshd:192.168.0.222:allow \/\/\u591a\u4e2aIP\u53ef\u4ee5\u6309\u7167\u6b64\u683c\u5f0f\u5199\u591a\u884c<\/code>
\n# vim \/etc\/hosts.deny<\/span>\u6700\u540e\u4e00\u884c\u52a0\u5165\uff1a
\nsshd:ALL \/\/\u9664\u4e86\u4e0a\u9762\u5141\u8bb8\u767b\u5f55\u7684IP\uff0c\u5176\u5b83IP\u90fd\u62d2\u7edd\u767b\u5f55
\n# service sshd restart<\/code>
\n192.168.0.222\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"
\n192.168.1.135\u4e0d\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"<\/p>\n

\u793a\u4f8b2\uff1a\u53ea\u5141\u8bb8192.168.1\u7f51\u6bb5\u7684\u4e3b\u673a\u767b\u5f55192.168.1.81<\/strong><\/div>\n

# vim \/etc\/hosts.allow<\/span>\u6700\u540e\u4e00\u884c\u52a0\u5165
\nsshd:192.168.1.*:allow<\/code><\/p>\n

# vim \/etc\/hosts.deny<\/span>\u6700\u540e\u4e00\u884c\u52a0\u5165\uff1a
\nsshd:ALL<\/code><\/p>\n

# service sshd restart
\n192.168.0.222\u4e0d\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"
\n192.168.1.135\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"<\/p>\n

\u793a\u4f8b3\uff1a\u53ea\u5141\u8bb8192.168.0.222\u4ee5keyso\u7528\u6237\u8eab\u4efd\u3001192.168.1.135\u4ee5root\u7528\u6237\u8eab\u4efd\u767b\u5f55192.168.1.81<\/strong><\/div>\n

# vim \/etc\/ssh\/sshd_config<\/span>\u6700\u540e\u4e00\u884c\u52a0\u5165
\nAllowUsers keyso@192.168.0.222 root@192.168.1.135 \/\/\u591a\u4e2a\u7528\u6237\u540d@IP\u4e4b\u95f4\u4f7f\u7528\u7a7a\u683c\u5206\u9694<\/code><\/p>\n

# service sshd restart
\n192.168.0.222\u4ee5\u9ed8\u8ba4\u7684root\u7528\u6237\u8eab\u4efd\u4e0d\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"
\n192.168.0.222\u4ee5keyso\u7528\u6237\u8eab\u4efd\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"
\n192.168.1.135\u4ee5\u9ed8\u8ba4\u7684root\u7528\u6237\u8eab\u4efd\u80fd\u6b63\u5e38\u767b\u5f55<\/span>
\n\"\"<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.linuxidc.com\/Linux\/2017-10\/147255.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/centos-ssh-ip-user.html<\/a>\u7f16\u8f91\uff1a\u51af\u632f\u534e\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

CentOS \u4e0b\u8bbe\u7f6eSSH\u53ea\u5141\u8bb8\u7279\u5b9a\u7528\u6237\u4ece\u7279\u5b9a\u7684IP\u767b\u5f55\uff0c\u5176\u5b83\u672a\u7ecf\u5141\u8bb8\u7684\u7528\u6237\u548cIP\u90fd\u4e0d\u80fd\u767b\u5f55\u3002 \u6f14\u793a\u73af\u5883 19 […]<\/p>\n","protected":false},"author":63,"featured_media":85749,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-85732","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\/85732","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=85732"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/85732\/revisions"}],"predecessor-version":[{"id":85809,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/85732\/revisions\/85809"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/85749"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=85732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=85732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=85732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}