{"id":1930,"date":"2017-08-15T09:15:55","date_gmt":"2017-08-15T03:45:55","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1930"},"modified":"2026-09-02T17:27:04","modified_gmt":"2026-09-02T11:57:04","slug":"enable-root-login-newly-installed-ubuntu-server-16-04-2","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/enable-root-login-newly-installed-ubuntu-server-16-04-2\/","title":{"rendered":"Enable Root login in newly installed Ubuntu Server 16.04.2"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a newly installed Ubuntu Server, the root user is commonly disabled for direct login by default. Administrative tasks such as installing applications, updating packages, or modifying system configurations require elevated privileges.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to set a password for the root user on a newly installed <strong>Ubuntu Server 16.04.2<\/strong> and provides the commands that can be used to access a root shell.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, ensure the following requirements are met:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>A newly installed <strong>Ubuntu Server 16.04.2<\/strong> is available.<\/li>\n\n\n\n<li>A local user account has already been created during the Ubuntu installation.<\/li>\n\n\n\n<li>The local user has permission to use <code>sudo<\/code>.<\/li>\n\n\n\n<li>You have access to the server through SSH or the local console.<\/li>\n\n\n\n<li><\/li>\n<\/ol>\n\n\n<h4>Implementation:<\/h4>\n<p class=\"isSelectedEnd\">Consider this a fresh Ubuntu Server 16.04.2 installation. During the installation, a local username for example <code dir=\"ltr\">ABC<\/code>, and a password have been created.<\/p>\n<p>If you need to perform administrative tasks such as updating the server or installing an application, you can set a password for the root user using the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo passwd root<\/pre>\n<p>You will be prompted to enter a new UNIX password for root. Enter the password twice.<\/p>\n<p>You will get a message &#8220;Passwd: Password updated successfully&#8221;.Now the new password for Root is set.<\/p>\n<p>Once the root password is set, we can perform apt-get upgrade or apt-get update.<\/p>\n<p>Other ways to log in as Root are as follows.<\/p>\n<ol>\n<li>sudo -i<\/li>\n<li>su<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Enabling the root user&#8217;s password on a newly installed Ubuntu Server allows administrators to perform system-level tasks using the root account. However, for security reasons, it is generally recommended to use <code>sudo<\/code> for administrative operations instead of enabling direct root SSH login.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Commands such as <code>sudo -i<\/code> provide a convenient way to obtain a root shell while maintaining better control over administrative access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FQAs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. How do I set a root password in Ubuntu Server 16.04.2?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can set the root password using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo passwd root<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. How can I switch to the root user in Ubuntu?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can switch to a root shell using either: <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo -i<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Is it safe to enable root login on Ubuntu Server?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It is generally safer to use <code>sudo<\/code> instead of allowing direct root login, especially over SSH. If root SSH login is enabled, use strong authentication and restrict SSH access to trusted users or networks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/change-ssh-default-port-disable-ssh-root-login\/\">https:\/\/pheonixsolutions.com\/blog\/change-ssh-default-port-disable-ssh-root-login\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<strong>:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our experts can help with <strong>web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions<\/strong>. Get in touch with our team <a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In a newly installed Ubuntu Server, the root user is commonly disabled for direct login by default. Administrative tasks [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[319,274],"class_list":["post-1930","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-ssh","tag-ubuntu","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-v8","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1930"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1930\/revisions"}],"predecessor-version":[{"id":11315,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1930\/revisions\/11315"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}