{"id":278,"date":"2018-03-08T00:00:40","date_gmt":"2018-03-07T16:00:40","guid":{"rendered":"https:\/\/cloudbool.com\/archive\/?p=278"},"modified":"2018-03-08T00:00:40","modified_gmt":"2018-03-07T16:00:40","slug":"centos-debian-ubuntu-modify-ssh-port","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/centos-debian-ubuntu-modify-ssh-port.html","title":{"rendered":"CentOS\/Debian\/Ubuntu\u66f4\u6539SSH\u7aef\u53e3"},"content":{"rendered":"<p>\u51fa\u4e8e\u5b89\u5168\u8003\u8651\uff0c\u6211\u4eec\u53ef\u80fd\u4e0d\u60f3\u7528SSH\u9ed8\u8ba4\u768422\u7aef\u53e3\u8fdb\u884c\u8fde\u63a5\uff0c\u6bd5\u7adf\u626b\u63cf\u5f31\u5bc6\u7801\u7684\u592a\u591a\u4e86\uff0c\u867d\u7136\u4e0d\u4e00\u5b9a\u80fd\u6210\u529f\u88ab\u7206\u7834\uff0c\u4f46\u662f\u770b\u90a3\u4e00\u5927\u5806\u7206\u7834\u65e5\u5fd7\u4e5f\u4e0d\u723d\uff0c\u867d\u7136\u6211\u4eec\u53ef\u4ee5\u542f\u7528\u8bc1\u4e66\u767b\u5f55\uff0c\u4f46\u662f\u76f8\u5bf9\u6765\u8bf4\uff0c\u66f4\u6539SSH\u7aef\u53e3\u4f1a\u65b9\u4fbf\u4e00\u70b9\u3002<br \/>\n<!--more--><br \/>\n\u5e38\u89c1\u7684\u51e0\u4e2a\u53d1\u884c\u7248\uff0cCentOS\/Debian\/Ubuntu\uff0cSSH\u7684\u914d\u7f6e\u5176\u5b9e\u90fd\u5dee\u4e0d\u591a\u7684\uff0c\u914d\u7f6e\u6587\u4ef6\u90fd\u662f<strong><em>\/etc\/ssh\/sshd_config<\/em><\/strong>\uff0c\u6211\u4eec\u66f4\u6539SSH\u7aef\u53e3\uff0c\u53ea\u9700\u66f4\u6539\u5176\u4e2d<strong><em>Port<\/em><\/strong>\u7684\u503c\uff1a<\/p>\n<pre><code>[root@BWH123 ~]# vim \/etc\/ssh\/sshd_config\nPort 22\n<\/code><\/pre>\n<p>\u5c06\u4e0a\u9762\u768422\u6539\u6210\u4f60\u60f3\u8981\u7684\u7aef\u53e3\uff0c\u7136\u540e\u91cd\u542fSSH\u670d\u52a1\u5c31\u884c\u4e86\uff1a<\/p>\n<pre><code>systemctl restart sshd\n<\/code><\/pre>\n<p>\u6216<\/p>\n<pre><code>systemctl restart ssh\n<\/code><\/pre>\n<p>\u6216<\/p>\n<pre><code>service ssh restart\n<\/code><\/pre>\n<p>\u6ce8\u610f\u60f3\u8981\u4f7f\u7528\u7684\u7aef\u53e3\uff0c\u9632\u706b\u5899\u5fc5\u987b\u5df2\u7ecf\u653e\u884c\uff0c\u4e0d\u7136\u53ef\u80fd\u4f1a\u628a\u81ea\u5df1\u5f53\u5728\u95e8\u5916\u3002<br \/>\n\u8fd8\u8981\u6ce8\u610f\u4e00\u70b9\u7684\u662f\uff0c\u5982\u679c\u7cfb\u7edf\u662fCentOS7\uff0c\u66f4\u6539SSH\u7aef\u53e3\u4e4b\u540e\uff0c\u8fd8\u9700\u8981\u5728SELinux\u505a\u76f8\u5e94\u7684\u5904\u7406\uff0c\u6211\u5bf9SELinux\u4e0d\u719f\u6089\uff0c\u4e00\u822c\u90fd\u662f\u76f4\u63a5\u5173\u95ed\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u51fa\u4e8e\u5b89\u5168\u8003\u8651\uff0c\u6211\u4eec\u53ef\u80fd\u4e0d\u60f3\u7528SSH\u9ed8\u8ba4\u768422\u7aef\u53e3\u8fdb\u884c\u8fde\u63a5\uff0c\u6bd5\u7adf\u626b\u63cf\u5f31\u5bc6\u7801\u7684\u592a\u591a\u4e86\uff0c\u867d\u7136\u4e0d\u4e00\u5b9a\u80fd\u6210\u529f\u88ab\u7206\u7834\uff0c\u4f46\u662f &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/centos-debian-ubuntu-modify-ssh-port.html\"> <span class=\"screen-reader-text\">CentOS\/Debian\/Ubuntu\u66f4\u6539SSH\u7aef\u53e3<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[182],"tags":[17,27,99,103],"class_list":["post-278","post","type-post","status-publish","format-standard","hentry","category-linux","tag-centos","tag-debian","tag-ssh","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}