{"id":3411,"date":"2009-12-14T16:36:35","date_gmt":"2009-12-14T20:36:35","guid":{"rendered":"https:\/\/apps4rent.com\/support\/?p=3411"},"modified":"2013-05-28T05:52:58","modified_gmt":"2013-05-28T09:52:58","slug":"how-to-change-ssh-port-in-centos","status":"publish","type":"post","link":"https:\/\/www.apps4rent.com\/support\/kb\/article\/how-to-change-ssh-port-in-centos","title":{"rendered":"How to change SSH port in CentOS?"},"content":{"rendered":"<p><strong>Changing SSH port in Centos<\/strong><\/p>\n<p>The discussion below refers to any CentOS Linux servers on Apps4Rent&#8217;s Hyper-V Virtual Dedicated Server platform<\/p>\n<p>To change the SSH port you need to update your sshd_config file and finally reload the configuration so that it can take effect.<\/p>\n<p>NOTE: The steps provided here are on a best effort basis. If you change the port incorrectly then you would loose connectivity to your server via SSH. In such a scenario you will need to contact support. For unmanaged servers; you will be billed on an hourly basis. We will then try to reset the port and pass the details to you.<br \/>\nThis example will assist you in changing the ssh port to nnnn&lt;port number that you wish to use; Please replace nnnn with valid port number&gt;<br \/>\n1. From your terminal session, edit \/etc\/ssh\/sshd_config<br \/>\nvi \/etc\/ssh\/sshd_config<br \/>\n2. Look for the following line:<br \/>\n#Port 22<br \/>\n3. Change the line so it looks like this:<br \/>\nPort nnnn &lt;port number that you wish&gt;<br \/>\n4. Save and close the file<br \/>\n5. Load the new configuration by using the service command<br \/>\nservice sshd restart<br \/>\nNOTE: This command with restart sshd; and as a result you will loosed the existing connectivity to the current ssh connection. You need to open a new session of ssh and use the right ports to connect to server.<br \/>\n$ ssh username@myhostnaname.com -p nnnn &lt;port number chosen in step 3&gt;<\/p>\n<p><strong>Related Links:<\/strong><\/p>\n<p><a title=\"MOSS Hosting\" href=\"http:\/\/www.apps4rent.com\/microsoft-office-sharepoint-server-moss-2007-hosting\/moss-2007-sharepoint.html\">MOSS Hosting<\/a><\/p>\n<p><a title=\"Hyper-V Hosting\" href=\"http:\/\/www.apps4rent.com\/Server-Virtualization-VPS-Software-Hosting\/Microsoft-Hyper-V-2008\/hyper-v-hosting.html\" target=\"_blank\">Windows Hyper-V Hosting<\/a><\/p>\n<p><a title=\"Virtual Dedicated Servers\" href=\"http:\/\/www.apps4rent.com\/virtual-dedicated-private-server-windows-hyper-v-vds-vs-vps-hosting\/virtual-dedicated-server.html\" target=\"_blank\">Virtual Dedicated Servers (VDS)<\/a><\/p>\n<p><a title=\"Hyper-V Price Plans\" href=\"http:\/\/www.apps4rent.com\/Hyper-V-Hosting-Services-Pricing-Plans\/hyperv-hostingplans.html\" target=\"_blank\">Hyper-V Price Plans<\/a><\/p>\n<p><a title=\"Hyper-V Features\" href=\"http:\/\/www.apps4rent.com\/Hosting-Hyper-V-Virtualization-Server-Virtual-Private-Architecture-Features\/hyperv-features.html\" target=\"_blank\">Hyper-V Features<\/a><\/p>\n<p><a title=\"Server Administration Plan\" href=\"http:\/\/www.apps4rent.com\/server-administration-managed-services-plans-hyper-v-kaseya-hosting.html\">Server Administration Plan<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Changing SSH port in Centos The discussion below refers to any CentOS Linux servers on Apps4Rent&#8217;s Hyper-V Virtual Dedicated Server platform To change the SSH port you need to update your sshd_config file and finally reload the configuration so that it can take effect. NOTE: The steps provided here are on a best effort basis. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1056,1054],"tags":[],"class_list":["post-3411","post","type-post","status-publish","format-standard","hentry","category-hyper-v","category-virtual-servers"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/posts\/3411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/comments?post=3411"}],"version-history":[{"count":0,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/posts\/3411\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/media?parent=3411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/categories?post=3411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/tags?post=3411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}