Detailed tutorial on how to log in to the system using the root user in the new version of Ubuntu 20.04

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 does not have root login enabled by default, which is very inconvenient when we operate and configure files on the desktop. So here we teach you how to log in to the desktop directly as root, which makes the system very convenient.

1: Set the root user password

Right-click on the desktop and select Open in Terminal to open the terminal emulator and execute sudo passwd root
Then enter the set password twice, and this completes the setting of the root user password.

2: Modify the configuration file

2.1: Modify 50-ubuntu.conf

Execute sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf and change the configuration to the following

[Seat:*]
user-session=ubuntu
greeter-show-manual-login=true
all-guest=false #This does not need to be configured

2.1: Modify gdm-autologin and gdm-password

Execute sudo vim /etc/pam.d/gdm-autologin and comment out the line auth required pam_succeed_if.so user != root quiet_success (around the third line)

#%PAM-1.0
auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success
auth optional pam_gdm.so
auth optional pam_gnome_keyring.so
auth required pam_permit.so

Execute sudo vim /etc/pam.d/gdm-password to comment out the line auth required pam_succeed_if.so user != root quiet_success (around the third line)

#%PAM-1.0
auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success
@include common-auth
auth optional pam_gnome_keyring.so
@include common-account

2.2: Modify the /root/.profile file

Execute sudo vim/root/.profile to modify the configuration file as follows

# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
 if [ -f ~/.bashrc ]; then
  . ~/.bashrc
 fi
fi
tty -s && mesg n || true
mesg n || true

Three: Restart the system to make it take effect

After restarting, the original user login selection is not listed.

insert image description here

Log in as root user

Summarize

This is the end of this article about how to use the root user to log in to the system in the new version of ubuntu20.04. For more relevant content about how to use the root user to log in to the system in ubuntu20.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:
  • Setting up time synchronization using NTP in Ubuntu
  • How to change password and set password complexity policy in Ubuntu
  • Ubuntu opens port 22
  • How to install and configure GitLab on Ubuntu 20.04
  • How to install vncserver in Ubuntu 20.04
  • Ubuntu20.04 VNC installation and configuration implementation
  • Modification of the default source sources.list file of ubuntu20.04 LTS system
  • Using NTP for Time Synchronization in Ubuntu

<<:  js version to realize calculator function

>>:  Detailed explanation of MySQL Truncate usage

Recommend

js memory leak scenarios, how to monitor and analyze them in detail

Table of contents Preface What situations can cau...

Summary of MySQL slow log related knowledge

Table of contents 1. Introduction to Slow Log 2. ...

Web page HTML ordered list ol and unordered list ul

Lists for organizing data After learning so many ...

Pagination Examples and Good Practices

<br />Structure and hierarchy reduce complex...

JavaScript exquisite snake implementation process

Table of contents 1. Create HTML structure 2. Cre...

Nginx stream configuration proxy (Nginx TCP/UDP load balancing)

Prelude We all know that nginx is an excellent re...

Upgrade Docker version of MySQL 5.7 to MySQL 8.0.13, data migration

Table of contents 1. Back up the old MySQL5.7 dat...

About Zabbix custom monitoring items and triggers

Table of contents 1. Monitoring port Relationship...

js to realize payment countdown and return to the home page

Payment countdown to return to the home page case...

How to create a test database with tens of millions of test data in MySQL

Sometimes you need to create some test data, base...

Pure JavaScript to implement the number guessing game

Develop a number guessing game that randomly sele...

html option disable select select disable option example

Copy code The code is as follows: <select> ...