{"id":8392,"date":"2023-03-06T10:30:22","date_gmt":"2023-03-06T10:30:22","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=8392"},"modified":"2026-02-26T14:02:44","modified_gmt":"2026-02-26T14:02:44","slug":"how-can-you-change-the-ssh-port-html","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/","title":{"rendered":"How Can you Change the SSH port.html"},"content":{"rendered":"\r\n<p>In this article, we will explain what SSH is and how to modify the SSH port.html<\/p>\r\n\r\n\r\n\r\n<p><strong>Secure Shell<\/strong> or <strong>Socket Shell <\/strong>(SSH) is a network protocol for assigning users to certain system administrators. It allows secure access to a website or an unprotected network.<\/p>\r\n\r\n\r\n\r\n<p>It also refers to a collection of tools that implement the SSH protocol. Strong password authentication and public key authentication are both available with SSH. The data is secure, as is the communication between the two computers.<\/p>\r\n\r\n\r\n\r\n<p>Now the steps to change the SSH port.html<\/p>\r\n\r\n\r\n\r\n<p><strong>1.<\/strong> You must allow traffic to the new SSH port through any firewall that is currently blocking traffic to the server.<\/p>\r\n\r\n\r\n\r\n<p><strong>2.<\/strong> To connect to the server, you must use the current SSH port<strong> (default 22).<\/strong> It&#8217;s important to maintain the SSH connection until you&#8217;re sure you&#8217;ll be able to use SSH on the new port number.<\/p>\r\n\r\n\r\n\r\n<p><strong>3.<\/strong> Now set the port line in \/etc\/ssh\/sshd_config. If this line does not already exist, you can add it.<\/p>\r\n\r\n\r\n\r\n<p>Lines that have been commented on will begin with a # character, which can be removed to make them uncommented. The Port line will look something like this, with 1234 replaced by the port number you want to use.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>Port 1234<\/code><\/pre>\r\n\r\n\r\n\r\n<p><strong>4.<\/strong> It&#8217;s time to restart SSHD.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-verse\">\/scripts\/restartsrv_sshd<\/pre>\r\n\r\n\r\n\r\n<p><strong>5.<\/strong> Once the new port is there, you need to test the SSH. On Linux, here&#8217;s an example of how to set port 1234 via SSH.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-verse\">ssh USER@HOSTNAME -p1234<\/pre>\r\n\r\n\r\n\r\n<p><strong>6.<\/strong> If the SSH test on the new port passes, you can close the connection used to change the port and make any further changes you desire, including closing the old SSH port. If it fails, you&#8217;ll need to use the currently active SSH connection to troubleshoot. This SSH connection should be retained until the SSH test on the new port passes.<\/p>\r\n\r\n\r\n\r\n<p>We hope that you now have a good understanding of Changing the SSH port.html. If you continue to have problems with the protocol outlined above,\u00a0<span style=\"box-sizing: border-box;\">don&#8217;t hesitate to get in touch with the\u00a0<a href=\"https:\/\/www.bodhost.com\/\" target=\"_blank\" rel=\"noopener\"><strong>bodHOST<\/strong><\/a><strong>\u00a0<\/strong>Team<\/span>\u00a0for constructive assistance 24\u00d77.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-verse\"><strong>Read Also: <a href=\"https:\/\/www.bodhost.com\/kb\/how-to-generate-a-new-key-ssh-access\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Generate A New Key SSH Access<\/a><\/strong><\/pre>\r\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will explain what SSH is and how to modify the SSH port.html Secure Shell or Socket Shell (SSH) is a network protocol for assigning users to&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[1396,1151],"class_list":["post-8392","post","type-post","status-publish","format-standard","hentry","tag-change-the-ssh-port-html","tag-ssh"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How Can you Change the SSH port.html<\/title>\n<meta name=\"description\" content=\"In this article, we have explained to you how to change the SSH port.html. For more information you can visit our website.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How Can you Change the SSH port.html\" \/>\n<meta property=\"og:description\" content=\"In this article, we have explained to you how to change the SSH port.html. For more information you can visit our website.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-06T10:30:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:02:44+00:00\" \/>\n<meta name=\"author\" content=\"Vincer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vincer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-can-you-change-the-ssh-port-html\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-can-you-change-the-ssh-port-html\\\/\"},\"author\":{\"name\":\"Vincer\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\"},\"headline\":\"How Can you Change the SSH port.html\",\"datePublished\":\"2023-03-06T10:30:22+00:00\",\"dateModified\":\"2026-02-26T14:02:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-can-you-change-the-ssh-port-html\\\/\"},\"wordCount\":347,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"Change the SSH port.html\",\"SSH\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-can-you-change-the-ssh-port-html\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-can-you-change-the-ssh-port-html\\\/\",\"name\":\"How Can you Change the SSH port.html\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2023-03-06T10:30:22+00:00\",\"dateModified\":\"2026-02-26T14:02:44+00:00\",\"description\":\"In this article, we have explained to you how to change the SSH port.html. For more information you can visit our website.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-can-you-change-the-ssh-port-html\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\",\"name\":\"Vincer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"caption\":\"Vincer\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/vinayak\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How Can you Change the SSH port.html","description":"In this article, we have explained to you how to change the SSH port.html. For more information you can visit our website.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/","og_locale":"en_US","og_type":"article","og_title":"How Can you Change the SSH port.html","og_description":"In this article, we have explained to you how to change the SSH port.html. For more information you can visit our website.","og_url":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2023-03-06T10:30:22+00:00","article_modified_time":"2026-02-26T14:02:44+00:00","author":"Vincer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vincer","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/"},"author":{"name":"Vincer","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0"},"headline":"How Can you Change the SSH port.html","datePublished":"2023-03-06T10:30:22+00:00","dateModified":"2026-02-26T14:02:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/"},"wordCount":347,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["Change the SSH port.html","SSH"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/","url":"https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/","name":"How Can you Change the SSH port.html","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2023-03-06T10:30:22+00:00","dateModified":"2026-02-26T14:02:44+00:00","description":"In this article, we have explained to you how to change the SSH port.html. For more information you can visit our website.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/how-can-you-change-the-ssh-port-html\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0","name":"Vincer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","caption":"Vincer"},"url":"https:\/\/www.bodhost.com\/kb\/author\/vinayak\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/8392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=8392"}],"version-history":[{"count":10,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/8392\/revisions"}],"predecessor-version":[{"id":14667,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/8392\/revisions\/14667"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=8392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=8392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=8392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}