{"id":6521,"date":"2021-05-23T13:54:28","date_gmt":"2021-05-23T13:54:28","guid":{"rendered":"https:\/\/truehost.co.ke\/support\/?post_type=ht_kb&#038;p=6521"},"modified":"2024-06-07T13:03:09","modified_gmt":"2024-06-07T13:03:09","password":"","slug":"how-to-secure-a-vps-secure-ssh","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/","title":{"rendered":"HOW TO SECURE A VPS: Secure SSH"},"content":{"rendered":"\n<p class=\"has-drop-cap\">In recent times the importance of securing DATA is widely recognized as the direct connection between the data and revenue becomes more clear to organizations and individuals. So how do you secure your data??<\/p>\n\n\n\n<p>Well, it starts by securing the host of the data and in this Article we will look into how to secure your Virtual Private Server (VPS).<\/p>\n\n\n\n<p>We have identified <strong>5 most essential security measures <\/strong>to take to ensure your VPS and data is secure<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>CHANGE THE DEFAULT SSH LOGIN METHOD<\/strong><\/h3>\n\n\n\n<p>SSH is the SECURE SHELL. This is a service that allows us  to do remote connections computer-to-computer. In most cases when a VPS is provisioned, SSH logins and credentials are also provided. <\/p>\n\n\n\n<p>If you use SSH to login to your VPS or have the service open just incase your GUI (Graphical User Interface) has an issue. Here is how to secure this service.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"schema-how-to wp-block-yoast-how-to-block\"><p class=\"schema-how-to-description\"><\/p> <ol class=\"schema-how-to-steps\"><li class=\"schema-how-to-step\" id=\"how-to-step-1621190079787\"><strong class=\"schema-how-to-step-name\">CHANGE THE DEFAULT SSH USER<\/strong> <p class=\"schema-how-to-step-text\">In most cases the default  user is *<strong>root<\/strong>*. <br\/>Login in as root is not recommended, due to a couple of reasons, but the most important is that the user <strong>root<\/strong> is the default administrator, who can perform any administrative task which includes deleting other users and their files. <br\/>We, therefore, need to disable login as root.<br\/><br\/><strong>1. <\/strong>Step one is to create another user. In this case, I call the user   <strong>user1.<\/strong> <br\/><strong>#useradd -m -d \/home\/user-home user1 <\/strong>&#8211;> Create the user<br\/><strong>#passwd user1<\/strong> &#8211;> Set password for user<br\/><br\/><strong>2<\/strong>. Disable root login on SSH service configuration file.<br\/>The configuration file we will be editing is <strong>\/etc\/ssh\/sshd_config<\/strong>. <br\/>Change the PermitRootLogin from yes to NO. If it is commented with a hash, remove the hash.<br\/><img decoding=\"async\" alt=\"\" src=\"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png\"\/><\/p> <\/li><li class=\"schema-how-to-step\" id=\"how-to-step-1621190857552\"><strong class=\"schema-how-to-step-name\">CHANGE THE DEFAULT PORT<\/strong> <p class=\"schema-how-to-step-text\">The default SSH port is 22. We need to change this to a not so obvious port. In this case port 10019.<br\/>We still edit the <strong>\/etc\/ssh\/sshd_config<\/strong>.<br\/><br\/><img decoding=\"async\" src=\"\"\/><img decoding=\"async\" src=\"\"\/><img decoding=\"async\" alt=\"\" src=\"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/portssh1.png\"\/><\/p> <\/li><li class=\"schema-how-to-step\" id=\"how-to-step-1621192895572\"><strong class=\"schema-how-to-step-name\">Allow port through the firewall and restart the SSH service.<\/strong> <p class=\"schema-how-to-step-text\">After the changes on the ssh configuration file, a restart of the SSH services (sshd\/ssh) is required.<br\/><strong>#systemctl restart sshd<\/strong> or<strong> #systemctl restart ssh<\/strong><br\/>In most cases a default firewall is installed for most OS. For CentOS, Redhat and Fedora this firewall is<strong> firewalld<\/strong>. For Ubuntu the firewall is <strong>UFW<\/strong>. <br\/>You can always choose to disable the current firewall and install the one you are familiar with.<br\/>We need to allow the port through the firewall.<br\/><strong>#firewall-cmd &#8211;permanent &#8211;allow-port=10019\/udp<br\/>#firewall-cmd &#8211;permanent &#8211;allow-port=10019\/tcp<\/strong><br\/><strong>#firewall-cmd &#8211;reload<\/strong> <br\/><br\/><img loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"176\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH.png\" class=\"attachment-full size-full\" alt=\"\" style=\"max-width: 100%; height: auto;\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH.png 570w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH-300x93.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH-50x15.png 50w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH-320x99.png 320w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/p> <\/li><\/ol><\/div>\n\n\n\n<p>For better understanding, you can watch the following video.<\/p>\n\n\n\n<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=\"01:SECURING YOUR VPS: Secure SSH\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/OV23dli04UQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In recent times the importance of securing DATA is widely recognized as the direct connection between the data and revenue becomes more clear to organizations and individuals. So how do you secure your data?? Well, it starts by securing the host of the data and in this Article we will look into how to secure [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[],"doc_tag":[],"class_list":["post-6521","docs","type-docs","status-publish","hentry"],"year_month":"2026-06","word_count":419,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Amicah","author_nicename":"amicah","author_url":"https:\/\/truehost.com\/support\/author\/amicah\/"},"doc_category_info":[],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HOW TO SECURE A VPS: Secure SSH -<\/title>\n<meta name=\"description\" content=\"CHANGE THE DEFAULT SSH USER. Login in as root is not recommended as root is the default administrator. Step one is to create another user\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HOW TO SECURE A VPS: Secure SSH -\" \/>\n<meta property=\"og:description\" content=\"CHANGE THE DEFAULT SSH USER. Login in as root is not recommended as root is the default administrator. Step one is to create another user\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-07T13:03:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/\",\"name\":\"HOW TO SECURE A VPS: Secure SSH -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/sshdfdf.png\",\"datePublished\":\"2021-05-23T13:54:28+00:00\",\"dateModified\":\"2024-06-07T13:03:09+00:00\",\"description\":\"CHANGE THE DEFAULT SSH USER. Login in as root is not recommended as root is the default administrator. Step one is to create another user\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/sshdfdf.png\",\"contentUrl\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/sshdfdf.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HOW TO SECURE A VPS: Secure SSH\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"HowTo\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#howto-1\",\"name\":\"HOW TO SECURE A VPS: Secure SSH\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/\"},\"description\":\"\",\"step\":[{\"@type\":\"HowToStep\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#how-to-step-1621190079787\",\"name\":\"CHANGE THE DEFAULT SSH USER\",\"itemListElement\":[{\"@type\":\"HowToDirection\",\"text\":\"In most cases the default  user is *root*. Login in as root is not recommended, due to a couple of reasons, but the most important is that the user root is the default administrator, who can perform any administrative task which includes deleting other users and their files. We, therefore, need to disable login as root.1. Step one is to create another user. In this case, I call the user   user1. #useradd -m -d \\\/home\\\/user-home user1 --> Create the user#passwd user1 --> Set password for user2. Disable root login on SSH service configuration file.The configuration file we will be editing is \\\/etc\\\/ssh\\\/sshd_config. Change the PermitRootLogin from yes to NO. If it is commented with a hash, remove the hash.\"}],\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#schema-image-d56be62d180644270af1f272918ca4b4\",\"url\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/sshdfdf.png\",\"contentUrl\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/sshdfdf.png\"}},{\"@type\":\"HowToStep\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#how-to-step-1621190857552\",\"name\":\"CHANGE THE DEFAULT PORT\",\"itemListElement\":[{\"@type\":\"HowToDirection\",\"text\":\"The default SSH port is 22. We need to change this to a not so obvious port. In this case port 10019.We still edit the \\\/etc\\\/ssh\\\/sshd_config.\"}],\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#schema-image-46cd976f1c17e1513dac1099aaab6c41\",\"url\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/portssh1.png\",\"contentUrl\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/portssh1.png\"}},{\"@type\":\"HowToStep\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#how-to-step-1621192895572\",\"name\":\"Allow port through the firewall and restart the SSH service.\",\"itemListElement\":[{\"@type\":\"HowToDirection\",\"text\":\"After the changes on the ssh configuration file, a restart of the SSH services (sshd\\\/ssh) is required.#systemctl restart sshd or #systemctl restart sshIn most cases a default firewall is installed for most OS. For CentOS, Redhat and Fedora this firewall is firewalld. For Ubuntu the firewall is UFW. You can always choose to disable the current firewall and install the one you are familiar with.We need to allow the port through the firewall.#firewall-cmd --permanent --allow-port=10019\\\/udp#firewall-cmd --permanent --allow-port=10019\\\/tcp#firewall-cmd --reload\"}],\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-secure-a-vps-secure-ssh\\\/#schema-image-4efb9a678f1d75e47e5e808c78c3993a\",\"url\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/RESTARTSSH.png\",\"contentUrl\":\"https:\\\/\\\/truehost.co.ke\\\/support\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/RESTARTSSH.png\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HOW TO SECURE A VPS: Secure SSH -","description":"CHANGE THE DEFAULT SSH USER. Login in as root is not recommended as root is the default administrator. Step one is to create another user","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:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/","og_locale":"en_US","og_type":"article","og_title":"HOW TO SECURE A VPS: Secure SSH -","og_description":"CHANGE THE DEFAULT SSH USER. Login in as root is not recommended as root is the default administrator. Step one is to create another user","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/","article_modified_time":"2024-06-07T13:03:09+00:00","og_image":[{"url":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/","name":"HOW TO SECURE A VPS: Secure SSH -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png","datePublished":"2021-05-23T13:54:28+00:00","dateModified":"2024-06-07T13:03:09+00:00","description":"CHANGE THE DEFAULT SSH USER. Login in as root is not recommended as root is the default administrator. Step one is to create another user","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#primaryimage","url":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png","contentUrl":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"HOW TO SECURE A VPS: Secure SSH"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}},{"@type":"HowTo","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#howto-1","name":"HOW TO SECURE A VPS: Secure SSH","mainEntityOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/"},"description":"","step":[{"@type":"HowToStep","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#how-to-step-1621190079787","name":"CHANGE THE DEFAULT SSH USER","itemListElement":[{"@type":"HowToDirection","text":"In most cases the default  user is *root*. Login in as root is not recommended, due to a couple of reasons, but the most important is that the user root is the default administrator, who can perform any administrative task which includes deleting other users and their files. We, therefore, need to disable login as root.1. Step one is to create another user. In this case, I call the user   user1. #useradd -m -d \/home\/user-home user1 --> Create the user#passwd user1 --> Set password for user2. Disable root login on SSH service configuration file.The configuration file we will be editing is \/etc\/ssh\/sshd_config. Change the PermitRootLogin from yes to NO. If it is commented with a hash, remove the hash."}],"image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#schema-image-d56be62d180644270af1f272918ca4b4","url":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png","contentUrl":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/sshdfdf.png"}},{"@type":"HowToStep","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#how-to-step-1621190857552","name":"CHANGE THE DEFAULT PORT","itemListElement":[{"@type":"HowToDirection","text":"The default SSH port is 22. We need to change this to a not so obvious port. In this case port 10019.We still edit the \/etc\/ssh\/sshd_config."}],"image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#schema-image-46cd976f1c17e1513dac1099aaab6c41","url":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/portssh1.png","contentUrl":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/portssh1.png"}},{"@type":"HowToStep","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#how-to-step-1621192895572","name":"Allow port through the firewall and restart the SSH service.","itemListElement":[{"@type":"HowToDirection","text":"After the changes on the ssh configuration file, a restart of the SSH services (sshd\/ssh) is required.#systemctl restart sshd or #systemctl restart sshIn most cases a default firewall is installed for most OS. For CentOS, Redhat and Fedora this firewall is firewalld. For Ubuntu the firewall is UFW. You can always choose to disable the current firewall and install the one you are familiar with.We need to allow the port through the firewall.#firewall-cmd --permanent --allow-port=10019\/udp#firewall-cmd --permanent --allow-port=10019\/tcp#firewall-cmd --reload"}],"image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-vps-secure-ssh\/#schema-image-4efb9a678f1d75e47e5e808c78c3993a","url":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH.png","contentUrl":"https:\/\/truehost.co.ke\/support\/wp-content\/uploads\/2021\/05\/RESTARTSSH.png"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/6521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=6521"}],"version-history":[{"count":14,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/6521\/revisions"}],"predecessor-version":[{"id":7401,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/6521\/revisions\/7401"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=6521"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=6521"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=6521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}