{"id":7551,"date":"2021-02-03T10:38:18","date_gmt":"2021-02-03T10:38:18","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=7551"},"modified":"2021-02-04T09:59:43","modified_gmt":"2021-02-04T09:59:43","slug":"changing-ssh-port-for-whm-cpanel-server","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/","title":{"rendered":"Changing SSH Port for WHM\/ cPanel Server"},"content":{"rendered":"<p>SSH is the most favorate way to connect to any Linux\/ cPanel server when something goes wrong, and geeks still use it even for many tasks that a novice will do through the WHM interface. <\/p>\n<p>Have you ever noticed 1000s of invalid login attempts when you log in to SSH? On one of the servers we manage, it looked like this.<\/p>\n<div class=\"command-sh\">\n<pre>\r\nThere were 18261 failed login attempts since the last successful login.\r\nLast login: Tue Jan 26 01:28:48 2021 from xxx.xxx.xxx.xxx\r\n\r\n  CentOS Linux 7 (Core)\r\n\r\nLinux sub.server-host.net 4.19-ovh-xxxx-std-ipv6-64 #1179808 SMP Mon Mar 30 07:31:39 UTC 2020 x86_64 x86_64 x86_64 GNU\/Linux\r\n\r\n\r\n  Server        : 19182\r\n  IPv4          : xx.xxx.xxx.xx\r\n  IPv6          : xxxx:xxxx:xxx:xxxx::\r\n  Hostname      : sub.server-host.net\r\n<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p>On windows, we use Putty ssh client, which you can download from putty website <a href=\"https:\/\/www.putty.org\"> putty.org<\/a><br \/>\nThe best way to tackle these invalid attempts is to change the default ssh port, 22, to a custom one. <\/p>\n<div class=\"container-action-steps\">\n<h3>How To change the SSH port of your server.<\/h3>\n<ol class=\"cpanel-action-steps\">\n<li>Login to your server with your favorite SSH client (we use putty)<\/li>\n<li>If you use a firewall (for example, CSF Config Server Security &#038; Firewall, the best free firewall for cPanel servers), open the port in the firewall before you make a change.<\/li>\n<li>Edit config file for SSH\n<div class=\"command-sh\">\n<pre> nano \/etc\/ssh\/sshd_config<\/pre>\n<\/div>\n<\/li>\n<li>Find the line with #port 22 and (1) remove # (2) change the number. Chose a random number, or one that is easy to remember for you between 1024 to 65535. All the port numbers from 0 to 1023 are designated to famous privileged service.\n<div class=\"command-sh\">\n<pre>Port 9467<\/pre>\n<\/div>\n<\/li>\n<li>Resetart SSH Service\n<div class=\"command-sh\">\n<pre>systemctl restart sshd.service<\/pre>\n<\/div>\n<\/li>\n<li>Important Do not close the current SSH session yet. Logon to the server from the new putty session on the new port to ensure new arrangements are working.<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SSH is the most favorate way to connect to any Linux\/ cPanel server when something goes wrong, and geeks still use it even for many tasks that a novice will do through the WHM interface. Have you ever noticed 1000s of invalid login attempts when you log in to SSH? On one of the servers [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7551","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Changing SSH Port for WHM\/ cPanel Server - cPanel Plesk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Changing SSH Port for WHM\/ cPanel Server - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"SSH is the most favorate way to connect to any Linux\/ cPanel server when something goes wrong, and geeks still use it even for many tasks that a novice will do through the WHM interface. Have you ever noticed 1000s of invalid login attempts when you log in to SSH? On one of the servers [...]Continue Reading...\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Farooq Omer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\"},\"author\":{\"name\":\"Farooq Omer\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"headline\":\"Changing SSH Port for WHM\/ cPanel Server\",\"datePublished\":\"2021-02-03T10:38:18+00:00\",\"dateModified\":\"2021-02-04T09:59:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\"},\"wordCount\":227,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"articleSection\":[\"Cpanel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\",\"name\":\"Changing SSH Port for WHM\/ cPanel Server - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"datePublished\":\"2021-02-03T10:38:18+00:00\",\"dateModified\":\"2021-02-04T09:59:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Changing SSH Port for WHM\/ cPanel Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/fokado\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Changing SSH Port for WHM\/ cPanel Server - cPanel Plesk","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:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/","twitter_card":"summary_large_image","twitter_title":"Changing SSH Port for WHM\/ cPanel Server - cPanel Plesk","twitter_description":"SSH is the most favorate way to connect to any Linux\/ cPanel server when something goes wrong, and geeks still use it even for many tasks that a novice will do through the WHM interface. Have you ever noticed 1000s of invalid login attempts when you log in to SSH? On one of the servers [...]Continue Reading...","twitter_misc":{"Written by":"Farooq Omer","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/"},"author":{"name":"Farooq Omer","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"headline":"Changing SSH Port for WHM\/ cPanel Server","datePublished":"2021-02-03T10:38:18+00:00","dateModified":"2021-02-04T09:59:43+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/"},"wordCount":227,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"articleSection":["Cpanel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/","url":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/","name":"Changing SSH Port for WHM\/ cPanel Server - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"datePublished":"2021-02-03T10:38:18+00:00","dateModified":"2021-02-04T09:59:43+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/changing-ssh-port-for-whm-cpanel-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"Changing SSH Port for WHM\/ cPanel Server"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"},"url":"https:\/\/cpanelplesk.com\/wp62\/author\/fokado\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/7551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=7551"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/7551\/revisions"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=7551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=7551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=7551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}