Ubuntu 18.04 obtains root permissions and logs in as root user

Ubuntu 18.04 obtains root permissions and logs in as root user

Written in advance: In the following steps, you need to enter commands in the terminal. Friends who view the blog on the computer can directly copy and paste it into the terminal. Friends who view it on the mobile phone please note that the spaces in the command are required, otherwise the operation will fail.

1. Set the initial password for root

(1) Log in to the system, open the terminal, and enter the command:

sudo passwd root

(Set a password for the root user)

(2) Set a root password (it is recommended to keep it simple, it does not need to be complicated);

(3) Repeat the root password;

2. Modify the content of /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf file

Terminal input:

sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

Open the file and add the following two lines at the end of the file. Save and close it after completion (pay attention to this step, do not delete the original two lines in the file);

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

3. Enter the /etc/pam.d folder and modify the contents of the gdm-autologin and gdm-password files (refer to the command in step 2):

gdm-autologin file comment out the line auth required pam_success_if.so user!=root quiet_success

gdm-password file comment out the line auth required pam_success_if.so user!=root quiet_success

Note: To make a comment, just add "#" before the line, for example:

#auth required pam_success_if.so user!=root quiet_success

4. Modify the /root/.profile file

Terminal input:

sudo gedit /root/.profile

Open the file and change the last line to the following:

tty -s && mesg n || true

Save and close, restart, and after restarting, select "Not Listed" and enter the account root and password;

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Ubuntu 20.04 desktop installation and root permission activation and ssh installation details
  • Use MySQL to open/modify port 3306 and open access permissions in Ubuntu/Linux environment
  • How to control the permissions of ordinary users when mounting ext4 formatted hard disk in Ubuntu 16.04
  • Solution to the problem of unable to switch root permissions in Ubuntu 16.04
  • How to add/delete file permissions in Linux (Ubuntu)
  • Ubuntu uses the root user to log in/switch root permissions
  • Ubuntu/Linux command analysis for permission modification
  • Ubuntu does not have enough permissions to create a folder solution

<<:  A simple method to merge and remove duplicate MySQL tables

>>:  Nodejs converts JSON string into JSON object error solution

Recommend

Operate on two columns of data as new columns in sql

As shown below: select a1,a2,a1+a2 a,a1*a2 b,a1*1...

Notes on matching MySql 8.0 and corresponding driver packages

MySql 8.0 corresponding driver package matching A...

js to realize web music player

This article shares simple HTML and music player ...

Solution to the data asymmetry problem between MySQL and Elasticsearch

Solution to the data asymmetry problem between My...

Installing the ping tool in a container built by Docker

Because the Base images pulled by Docker, such as...

Steps to change mysql character set to UTF8 under Linux system

Table of contents 1. Check the MySQL status in th...

Detailed explanation of two ways to dynamically change CSS styles in react

The first method: dynamically add a class to show...

VMware + Ubuntu18.04 Graphic Tutorial on Building Hadoop Cluster Environment

Table of contents Preface VMware clone virtual ma...

Detailed explanation of mysql deadlock checking and deadlock removal examples

1. Query process show processlist 2. Query the co...

How to point the target link of a tag to iframe

Copy code The code is as follows: <iframe id=&...

Div css naming standards css class naming rules (in line with SEO standards)

There are many tasks to be done in search engine o...

JavaScript two pictures to understand the prototype chain

Table of contents 1. Prototype Relationship 2. Pr...

Teach you how to quickly install Nginx in CentOS7

Table of contents 1. Overview 2. Download the Ngi...