{"id":2661,"date":"2016-09-07T15:57:49","date_gmt":"2016-09-07T19:57:49","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2661"},"modified":"2017-12-12T15:56:18","modified_gmt":"2017-12-12T20:56:18","slug":"change-ssh-port-ubuntu-14","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/","title":{"rendered":"How to change SSH port on Ubuntu 14"},"content":{"rendered":"<h1>How to change SSH port on Ubuntu 14<\/h1>\n<p>If you administer a remote server, then you&#8217;re doubtlessly familiar with Secure Shell, or SSH. It&#8217;s a protocol that was first designed in 1995 and is still the gold standard for secure remote login and monitoring of systems. The current version is SSH-2, which fixed many vulnerabilities present in the original SSH-1 protocol.<\/p>\n<p>Because SSH is so ubiquitous, it&#8217;s also a common vector of attack for intruders. There are many methods for improving SSH security, including disabling password login (using a key instead) and disabling login as root. One can also use the obfuscation technique of simply changing your SSH port from the default 22 to something else. This has the added benefit of cutting down on the amount of automated bot attacks that clutter up your logs.<\/p>\n<p>This guide will walk you through the process of changing the SSH port on a server running Ubuntu 14.<\/p>\n<h2>Getting Started<\/h2>\n<p>Confirm that you have the following before you follow this guide:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) running a fresh installation of Ubuntu 14.<br \/>\n\u2022 Root access to the node.<\/p>\n<h2>Tutorial<\/h2>\n<p>sshd is the daemon that runs SSH on Linux. Its configuration file has many options that you can tweak to alter the daemon&#8217;s behavior on your machine. Open the file and edit it with the text editor of your choosing.<\/p>\n<p><code>nano \/etc\/ssh\/sshd_config<\/code><\/p>\n<p>It&#8217;s a simple matter to change the Port 22 default to your port of choice.<\/p>\n<p><code class=\"gris\">[...]<br \/>\n# What ports, IPs and protocols we listen for<br \/>\nPort 22 <----------------------------------------------------------------------- Change this value (22) by the port you want\n# Use these options to restrict which interfaces\/protocols sshd will bind to\n#ListenAddress ::\n#ListenAddress 0.0.0.0\nProtocol 2\n# HostKeys for protocol version 2\nHostKey \/etc\/ssh\/ssh_host_rsa_key\nHostKey \/etc\/ssh\/ssh_host_dsa_key\nHostKey \/etc\/ssh\/ssh_host_ecdsa_key\nHostKey \/etc\/ssh\/ssh_host_ed25519_key\n#Privilege Separation is turned on for security\nUsePrivilegeSeparation yes\n[...]<\/code><\/p>\n<p>Of course, you'll have to make sure not to use a port that's already in use by the server. Additionally, avoid the well-known ports 0-1023 and the registered ports 1024-49151, as they are generally reserved for other protocols and services. 49152 through 65535 are your best bet for a new port for your SSH service.<\/p>\n<p>Now, restart the SSH daemon so it will reflect the changes you've made.<\/p>\n<p><code>service ssh restart<\/code><\/p>\n<p>or<\/p>\n<p><code>\/etc\/init.d\/ssh restart<\/code><\/p>\n<p>Naturally, you'll need to verify that the port is allowed in your firewall. Otherwise, as soon you log out, if the firewall is set to port 22 you won't be able to log back in again.<\/p>\n<p><code>ufw allow xxxx\/tcp<\/code><\/p>\n<p>Make sure xxxx is the port you set in the ssh config file.<\/p>\n<h2>Conclusion<\/h2>\n<p>Now that you have changed SSH's default port, you can rest assured that your server is more secure. Remember to define the new port with the 'p' flag the next time you log into your server. If this guide was useful to you, share it with your friends! <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to change SSH port on Ubuntu 14 If you administer a remote server, then you&#8217;re doubtlessly familiar with Secure Shell, or SSH. It&#8217;s a protocol that was first designed in 1995 and is still the gold standard for secure remote login and monitoring of systems. The current version is SSH-2, which fixed many vulnerabilities<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"class_list":["post-2661","post","type-post","status-publish","format-standard","hentry","category-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to change SSH port on Ubuntu 14 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to change the SSH port number to any desired choice on your own Ubuntu 14 server. Read now !\" \/>\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.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to change SSH port on Ubuntu 14 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to change the SSH port number to any desired choice on your own Ubuntu 14 server. Read now !\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-07T19:57:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-12T20:56:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/\",\"name\":\"How to change SSH port on Ubuntu 14 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"datePublished\":\"2016-09-07T19:57:49+00:00\",\"dateModified\":\"2017-12-12T20:56:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to change the SSH port number to any desired choice on your own Ubuntu 14 server. Read now !\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to change SSH port on Ubuntu 14\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to change SSH port on Ubuntu 14 - Globo.Tech","description":"This tutorial will show you how to change the SSH port number to any desired choice on your own Ubuntu 14 server. Read now !","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.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/","og_locale":"en_US","og_type":"article","og_title":"How to change SSH port on Ubuntu 14 - Globo.Tech","og_description":"This tutorial will show you how to change the SSH port number to any desired choice on your own Ubuntu 14 server. Read now !","og_url":"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/","og_site_name":"Globo.Tech","article_published_time":"2016-09-07T19:57:49+00:00","article_modified_time":"2017-12-12T20:56:18+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/","url":"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/","name":"How to change SSH port on Ubuntu 14 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-09-07T19:57:49+00:00","dateModified":"2017-12-12T20:56:18+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to change the SSH port number to any desired choice on your own Ubuntu 14 server. Read now !","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/change-ssh-port-ubuntu-14\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to change SSH port on Ubuntu 14"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2661"}],"version-history":[{"count":4,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2661\/revisions"}],"predecessor-version":[{"id":4004,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2661\/revisions\/4004"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}