{"id":1891,"date":"2012-08-11T13:54:31","date_gmt":"2012-08-11T13:54:31","guid":{"rendered":"http:\/\/www.serverslot.com\/?p=1891"},"modified":"2013-01-23T17:44:38","modified_gmt":"2013-01-23T17:44:38","slug":"how-to-change-ssh-port-from-22-to-any-other-port-through-putty-in-linux-server","status":"publish","type":"post","link":"https:\/\/serverslot.com\/hosting-issues\/how-to-change-ssh-port-from-22-to-any-other-port-through-putty-in-linux-server\/","title":{"rendered":"How to change SSH port from 22 to any other port through Putty in Linux Server"},"content":{"rendered":"<p>How to change SSH port from 22 to any other port through Putty in Linux Server and why it is\u00a0necessary\u00a0to change the port<\/p>\n<p>&nbsp;<\/p>\n<p>Usually when a Linux server is delivered by data center or by default it is running under Port 22 for SSH which is really dangerous to keep with this port 22 open.<\/p>\n<p>Because if your port 22 will remain open for ssh then i am making you sure that you have given a full way to Server Hacker to hack your server from the root level, because it is very common that in linius servers port 22 opened by default so a hacker can easily access your server through this port, so it is highly recomended to change your SSH port from 22 to some one other, a port which is not being used for any other purpose.<\/p>\n<p>Now i will tell you how you can change your SSH port yourself quite easily through command line putty.<\/p>\n<p>Login to your server using your root credentials, once you get login, use below given commands<\/p>\n<p><strong>cd \/etc\/ssh<\/strong><\/p>\n<p><strong>sudo nano sshd_config<\/strong><\/p>\n<p>Here you must find the line #port 22 then edit 22 to any other port like 2001 (remove the # (hash tag) to allow the changes take effect)<\/p>\n<p>To exit out of the Nano editor, hit <span style=\"color: #ff0000;\">CRTL + X<\/span><\/p>\n<p>Hit <span style=\"color: #ff0000;\">Y<\/span> to save Changes<\/p>\n<p>Type following command \u201c<strong>service sshd restart<\/strong>\u201d<\/p>\n<p><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"ca-pub-6441688276343625\";\n\/* serverslot small horizontal *\/\ngoogle_ad_slot = \"7309259884\";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\n\/\/-->\n<\/script><br \/>\n<script type=\"text\/javascript\"\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><br \/>\n=======================<br \/>\n<script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"ca-pub-6441688276343625\";\n\/* serverslot small horizontal *\/\ngoogle_ad_slot = \"7309259884\";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\n\/\/-->\n<\/script><br \/>\n<script type=\"text\/javascript\"\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><br \/>\n<strong><em>You may also use below other commands if the above way will not work for you<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Login through SSH putty and use following command<br \/>\n<strong>vi \/etc\/ssh\/sshd_config<\/strong><\/p>\n<p><strong><\/strong><br \/>\nChange the line \u201c#<strong>Port 22? to \u201cPort 2000<\/strong>?<br \/>\nIn place of 2000 you may place any other number of port so that in the future you can use that port for ssh then type this command \u201c<strong>service sshd restart<\/strong>\u201d without quotes.<\/p>\n<p>After making these changes if you find any issue you may revert your setting by below give URL.<\/p>\n<p><strong>http:\/\/IP:2086\/scripts2\/doautofixer?autofix=safesshrestart<\/strong><\/p>\n<p>Replace &#8220;IP&#8221; with the IP address of your server, it will revert your sshd port to 22.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to change SSH port from 22 to any other port through Putty in Linux Server and why it is\u00a0necessary\u00a0to change the port &nbsp; Usually \u2026 <a href=\"https:\/\/serverslot.com\/hosting-issues\/how-to-change-ssh-port-from-22-to-any-other-port-through-putty-in-linux-server\/\">more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/posts\/1891"}],"collection":[{"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/comments?post=1891"}],"version-history":[{"count":0,"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/posts\/1891\/revisions"}],"wp:attachment":[{"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/media?parent=1891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/categories?post=1891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serverslot.com\/hosting-issues\/wp-json\/wp\/v2\/tags?post=1891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}