{"id":7914,"date":"2020-07-04T05:24:31","date_gmt":"2020-07-04T05:24:31","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=7914"},"modified":"2020-07-04T05:24:31","modified_gmt":"2020-07-04T05:24:31","slug":"how-to-enable-root-login-via-ssh-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/","title":{"rendered":"How to enable Root Login via SSH in Ubuntu"},"content":{"rendered":"<p>SSH on Ubuntu is by default configured in a way that disables the root users log in. Originally this is enabled as a security measure which means that you cannot directly log in as the root user over SSH. However, you can easily use the Root SSH login via Sudo command. But, in some conditions, it is more convenient to directly logged in as root.<\/p>\n<h2>Steps to enable Root login over SSH<\/h2>\n<p>1) Login to your<strong> server as root<\/strong>.<\/p>\n<p>2) Now you are a root user. So, edit the sshd_config file located in <strong><em>\/etc\/ssh\/sshd_config<\/em><\/strong><\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true\">vim \/etc\/ssh\/sshd_config<\/pre>\n<p>3) Now, add the following command to the file. Even though you can add it anywhere but we advise you to follow the best practice by adding the command in the block for authentication.<\/p>\n<pre class=\"screen\">PermitRootLogin yes<\/pre>\n<p>4) Save this file and exit.<\/p>\n<p>5) Restart your SSH server using the following command :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">systemctl restart sshd<\/pre>\n<p>Or<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">service sshd restart<\/pre>\n<p>That\u2019s it.<\/p>\n<p>With this, the new line gets added and the SSH server gets restart, this allows you now to connect via the root user.<br \/>\nIn this instance, you will be able to log in as the root user by using either the password or an SSH key.<br \/>\nIf you use SSH keys, you will be able to set the PermitRootLogin value to \u2018without-password\u2019 instead of yes. To complete this, just modify step 2 with the following command :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">PermitRootLogin without-password<\/pre>\n<p>This process works on all versions of the Linux server on which the sshd service is installed. In case you are using a cPanel server, still you can easily control this setting from the WHM interface. In such cases, we recommend you to modify this setting from your control panel interface.<\/p>\n<p><strong>Also Read :<\/strong><\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noopener\"><strong>How to Set Up SSH Keys on Ubuntu 18.04<\/strong><\/a><\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-chkrootkit-security-scanner-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noopener\"><strong>How To Install Chkrootkit Security Scanner On Ubuntu 18.04<\/strong><\/a><\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-postgresql-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noopener\"><strong>Learn to Install PostgreSQL on Ubuntu 18.04<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH on Ubuntu is by default configured in a way that disables the root users log in. Originally this is enabled as a security measure which means that you cannot directly log in as the root user over SSH. However, you can easily use the Root SSH login via Sudo command. But, in some conditions, [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1485,1483,121,1484,621],"class_list":["post-7914","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-web-hosting-faq","tag-enable-root-login","tag-root","tag-ssh","tag-sshd_config","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to enable Root Login via SSH in Ubuntu - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"An easy guide on how to enable Root Login via SSH in Ubuntu.\" \/>\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.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to enable Root Login via SSH in Ubuntu - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"An easy guide on how to enable Root Login via SSH in Ubuntu.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-04T05:24:31+00:00\" \/>\n<meta name=\"author\" content=\"Sonam Wagh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonam Wagh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/\",\"name\":\"How to enable Root Login via SSH in Ubuntu - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2020-07-04T05:24:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"description\":\"An easy guide on how to enable Root Login via SSH in Ubuntu.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to enable Root Login via SSH in Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\",\"name\":\"Sonam Wagh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"caption\":\"Sonam Wagh\"},\"description\":\"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to enable Root Login via SSH in Ubuntu - Web Hosting FAQs by MilesWeb","description":"An easy guide on how to enable Root Login via SSH in Ubuntu.","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.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/","og_locale":"en_GB","og_type":"article","og_title":"How to enable Root Login via SSH in Ubuntu - Web Hosting FAQs by MilesWeb","og_description":"An easy guide on how to enable Root Login via SSH in Ubuntu.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2020-07-04T05:24:31+00:00","author":"Sonam Wagh","twitter_misc":{"Written by":"Sonam Wagh","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/","name":"How to enable Root Login via SSH in Ubuntu - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2020-07-04T05:24:31+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"description":"An easy guide on how to enable Root Login via SSH in Ubuntu.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-enable-root-login-via-ssh-in-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to enable Root Login via SSH in Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4","name":"Sonam Wagh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","caption":"Sonam Wagh"},"description":"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/"}]}},"views":532,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=7914"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7914\/revisions"}],"predecessor-version":[{"id":7915,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7914\/revisions\/7915"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=7914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=7914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=7914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}