How to enable the root account in Ubuntu 20.04

How to enable the root account in Ubuntu 20.04

After Ubuntu 20.04 is installed, there is no root account login permission by default. Follow the steps below to complete the root account login in one step. Do you think it is very convenient after reading this?

1. First Step

Log in to the system as a normal user and create a password for the root user

Enter the command in the terminal: sudo passwd root


Then enter the set password twice, and the root user password is set (note that the password is not echoed in Linux system)

2. Step 2

Modify the 50-ubuntu.conf file

Enter the command in the terminal: sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf


Add the following two lines to the end of the file:

greeter-show-manual-login=true
all-guest=false 

3. Step 3

Modify the gdm-autologin file

Enter the command in the terminal: sudo gedit /etc/pam.d/gdm-autologin to open the file


Add # in front to comment out the third line auth required pam_succeed_if.so user != root quiet_success

4. Step 4

Modify the gdm-password file

Enter the command in the terminal: sudo gedit /etc/pam.d/gdm-password to open the file


Add # in front to comment out the third line auth required pam_succeed_if.so user != root quiet_success

5. Step 5

Modify the /root/.profile file

Enter the command in the terminal: sudo gedit /root/.profile to open the file


Change the line mesg n 2> /dev/null || true at the end of the file to
tty -s&&mesg n || true

6. Final Step

Please log out and log in again.

Select Not Listed?
Then enter root and the password you set previously to log in successfully

Click to get reference source

The next article will share with you how to copy and paste text from the Windows operating system to the Linux system under VMware virtual machine

This is the end of this article about the steps to enable the root account in Ubuntu 20.04. For more information about enabling the root account in Ubuntu 20.04, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed tutorial on how to log in to the system using the root user in the new version of Ubuntu 20.04
  • Ubuntu 20.04 desktop installation and root permission activation and ssh installation details

<<:  The scroll bar position is retained when scrolling the vant list component

>>:  Two ways to configure Vue global methods

Recommend

Summary of JavaScript JSON.stringify() usage

Table of contents 1. Usage 1. Basic usage 2. The ...

jQuery achieves the effect of advertisement scrolling up and down

This article shares the specific code of jQuery t...

MySQL 8.0.25 installation and configuration method graphic tutorial

The latest download and installation tutorial of ...

Seven different color schemes for website design experience

The color matching in website construction is ver...

Data storage implementation method in WeChat applet

Table of contents Global variable globalData Page...

MySQL high concurrency method to generate unique order number

Preface After this blog post was published, some ...

Solve the problem of Docker starting Elasticsearch7.x and reporting an error

Using the Docker run command docker run -d -p 920...

In-depth understanding of React Native custom routing management

Table of contents 1. Custom routing 2. Tab naviga...

Some points on using standard HTML codes in web page creation

<br />The most common mistake made by many w...

MySQL Order By Multi-Field Sorting Rules Code Example

Say it in advance On a whim, I want to know what ...

How to view the type of mounted file system in Linux

Preface As you know, Linux supports many file sys...