0% found this document useful (0 votes)
71 views

How To Enable Root Account in Ubuntu?: Download PDF

Uploaded by

Denis Cano
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

How To Enable Root Account in Ubuntu?: Download PDF

Uploaded by

Denis Cano
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

 English   sales@monovm.

com  LOGIN  SIGN UP

 0

How to Enable Root Account in Ubuntu?

How to enable the root account in Ubuntu? Find out this and much more in today's article.

Download
PDF


14 Dec, 21

5 min Read Tutorials
Server

List of content you will read in this article:

1. Temporary Method

2. Command-Line and Graphical User Interface Method

3. Command-line method

4. Conclusion

If you are a newbie, you may be scratching your head about how to enable your root account in Ubuntu! Well, for

several security purposes, the root user account is kept disabled. Before we begin, here is some preface. 

When you install Ubuntu, a root account is created. The catcher here is that you do not have the provision to set the
password for the account. 

Let us assist you in enabling the user account in Ubuntu! This tutorial will help you to understand several other
factors too, including how to disable the account and set up a password for your root account. Read on!
 

Follow the commands mentioned below to find out the root user account password details:

sudo grep root /etc/passwd

Output:

The x in the output signifies that the account’s password is empty.

sudo grep root /etc/shadow

Output:

Here, ! signifies that the password is locked. What does this mean? Well, this means that the user does not have

the access to set a password for the account. 

This is an issue, isn’t it? Here is a solution. Following are a few steps that you must follow in order to enable the

account and subsequently set a password:

Temporary Method

Command-Line and Graphical User Interface Method

Command-Line Method

Let us understand each method in detail.

Temporary Method
You use this method when you want to temporarily enable a root account. Follow the command mentioned below:

sudo -i

Output:

Now, if you want to disable an account, just log out of the session and type the following command:

exit

Output:
 

Command-Line and Graphical User Interface Method


When you follow this method, you can easily access your root account either from the GUI or the command line.

Use the following command:

sudo -i passwd root

Output:

As you can see, the password is updated successfully. 

Secondly, here is how you can access the root account through the graphical user interface.

Type root in the first textbox.

Type your root account password.


As soon as you type the password, you encounter an error message. The reason is that there is a security layer in

 the graphical interface that stops any login until and unless several other configuration files are configured. 

 This basically provides extra security. In order to log in through the graphical user interface, follow these steps and
edit the following files:

/etc/gdm3/custom.conf

/etc/pam.d/gdm-password

After editing these files, next up is to back up the following configuration files:

sudo cp /etc/gdm3/custom.conf /etc/gdm3/custom.conf_backup

sudo cp /etc/pam.d/gdm-password /etc/pam.d/gdm-password_backup


Now, simply, open the “/etc/gdm3/custom.conf” configuration file

sudo vi /etc/gdm3/custom.conf

Moving on, write the following mentioned line under the ‘security’ textbox.

AllowRoot=true

Output:

Press save and exit. 

Now, open “/etc/pam.d/gdm-password” which is a configuration file.

As soon as you hunt down the following line, add ‘#’ at the beginning of that line, just as shown below.

#auth required pam_succeed_if.so user != root quiet_success

Just save and hit exit on the ‘gdm’ configuration file.


In order to see the changes that you just made, simply reboot the system. To do so, type the following command:

sudo reboot -f

As you have rebooted your system, login into the root account now.

Bam! You can log in to the root account easily. 

Additionally, if you want to disable the root account, simply use the following command:

sudo passwd -dl root

Output:

Reverse whatever changes you made in the two configuration files earlier. 

Delete “AllowRoot=true” from the “/etc/gdm3/custom.conf” configuration file as shown below.

Next, delete the ‘#’ from  “/etc/pam.d/gdm-password”.

And you are done!

 
Command-line method
Using the command-line method, you can easily enable or disable the root account through the command line.
Here, you cannot log in through a graphical interface.

Use the following command, to enable the root account:

sudo -i passwd root

Output:

The screenshot shows that you can access the root account. Along with that, you can set the password for the root
account as well. Now, you can go to your root account by typing the following command:

su – root

Output:

Moreover, to disable the root account, enter:

sudo passwd -dl root

Output:

To be one hundred percent sure, switch to the root account and see if the process is successful.

If you see the same message like the above image, then yes, you have successfully disabled the account as now

you can see that the authentication has failed. 

Conclusion
These were few methods to help you enable or disable the root account in Ubuntu
These were few methods to help you enable or disable the root account in Ubuntu.

We hope that the article solved your queries and provided you with a better understanding of the topic. If you have
any questions or suggestions, please leave them in the comment section below.

Linux

Tags:


Category: Tutorials
Server

Antoniy Yushkevych
Master of word when it comes to technology, internet and privacy. I'm also your usual guy that always aims for the best
result and takes a skateboard to work. If you need me, you will find me at the office's Counter-Strike championships on
Fridays or at a.yushkevych@monovm.com

Name (required)

Email (required)

Website

Comment ...

POST COMMENT

Need Domain Name?


85% Promo on Domain Names

Dedicated server
E3-1240 V3 From $180/Monthly

Latest posts

How to use the print function in Python

IPv4 vs IPv6: What's the Difference? [A Details Co...

How to write comments in Python

What is .htaccess redirect?

Buy Cheap RDP



Buy Cheap RDP


Buy VPS


Cheap Linux VPS


Cheap Windows VPS

 Address: MonoVM
Networks

Sauletekio al. 15, Vilnius, Lithuania.

Registration Number: 304811786

Lithuania :
+370 5 205 5502

    

VPS Hosting Top Services

Buy VPS Dedicated Server

Buy RDP SSD VPS

Windows VPS Web Hosting

Linux VPS Domain


registration

Support

Knowledgebase

About us

Contact us

FAQ

Payment Method

©2022 MonoVM. All rights reserved Terms & Conditions | 


Privacy Policy

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy