{"id":906,"date":"2022-04-04T07:22:05","date_gmt":"2022-04-04T01:52:05","guid":{"rendered":"https:\/\/lookouthost.com\/?p=906"},"modified":"2022-04-04T07:22:07","modified_gmt":"2022-04-04T01:52:07","slug":"how-to-change-default-ssh-port-in-linux-ubuntu-or-centos","status":"publish","type":"post","link":"https:\/\/lookouthost.com\/blog\/how-to-change-default-ssh-port-in-linux-ubuntu-or-centos\/","title":{"rendered":"How To Change Default SSH Port in Linux, Ubuntu or Centos"},"content":{"rendered":"<ol class=\"wp-block-list\"><li>How to change the default SSH Port in Linux or Ubuntu which is 22 to increase the security.<\/li><li>Just loginto your SSH server using root.<\/li><li>Then use some editor like nano or vi to edit the sshd configuration file.<\/li><li>Then type nano \/etc\/ssh\/sshd_config<br>You can use other editor like vi if nano is not installed but working with vi is a little different.<\/li><li>If nano is not installed you can install is using yum install nano in CentOS.<\/li><li>Now lets save the new port number and exit.<\/li><li>Press Ctrl + X<\/li><li>Type Y for YES.<\/li><li>Don&#8217;t change the file name and save it by the default location\/name i.e. \/etc\/ssh\/sshd_config. Just press enter.<\/li><li>Once you have saved it just restart the system or the sshd service using the following command.<br>service sshd restart<\/li><li>Then see the active port by following command<br>service sshd status<\/li><\/ol><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"401\" src=\"https:\/\/lookouthost.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-04-064038-1024x401.png\" alt=\"\" class=\"wp-image-907\" srcset=\"https:\/\/lookouthost.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-04-064038-1024x401.png 1024w, https:\/\/lookouthost.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-04-064038-600x235.png 600w, https:\/\/lookouthost.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-04-064038-300x117.png 300w, https:\/\/lookouthost.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-04-064038-768x300.png 768w, https:\/\/lookouthost.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-04-064038.png 1360w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><p>You can also see this complete guide on How to Change Default Port of SSH in Linux, Ubuntu or Centos on our official Youtube channel.<\/p><figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How To Change Default SSH Port in Linux, Ubuntu or Centos\" width=\"790\" height=\"444\" src=\"https:\/\/www.youtube.com\/embed\/gEQ6XAshsEA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>","protected":false},"excerpt":{"rendered":"<p>How to change the default SSH Port in Linux or Ubuntu which is 22 to increase the security. Just loginto your SSH server using root. Then use some editor like nano or vi to edit the sshd configuration file. Then type nano \/etc\/ssh\/sshd_configYou can use other editor like vi if nano is not installed but working with vi is a little different. If nano is not installed you can install is using yum install nano in CentOS. Now lets save the new port number and exit. Press Ctrl + X Type Y for YES. Don&#8217;t change the file name and&hellip; <\/p>\n","protected":false},"author":1,"featured_media":909,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,20],"tags":[],"class_list":["post-906","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-ubuntu"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/posts\/906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/comments?post=906"}],"version-history":[{"count":0,"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/posts\/906\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/media\/909"}],"wp:attachment":[{"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/media?parent=906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/categories?post=906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lookouthost.com\/blog\/wp-json\/wp\/v2\/tags?post=906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}