Ubuntu 20.04 desktop installation and root permission activation and ssh installation details

Ubuntu 20.04 desktop installation and root permission activation and ssh installation details

The article mainly records the simple installation process of Ubuntu 20.04, replaces the domestic source after installation, installs openssh software, and enables root privilege login

Ubuntu 20.04 installation

The installation is relatively simple. After loading the image file, just follow the steps step by step.

Link: Ubuntu 20.04 installation detailed tutorial Follow this document to install successfully.

After successful installation, log in using the username used during the installation process.

After logging in, update the domestic source first. Here, choose Alibaba, or you can choose others.

This will update the source, and the subsequent installation of related software will be much faster.

ssh installation

Install ssh

sudo apt-get update
sudo apt-get install openssh-server

Set up SSH login for the root user

Modify the configuration file: /etc/ssh/sshd_config

Find the following settings

 Authentication: 
# LoginGraceTime 2m 
# PermitRootLogin prohibit-password 
# StrictModes yes

Replace with

# Authentication: 
LoginGraceTime 120 
#PermitRootLogin prohibit-password 
PermitRootLogin yes 
StrictModes yes

Restart the service

sudo /etc/ini.d/ssh restart

After the setup is complete, log in using ssh (username)@(IP).
Found that I couldn't log in

sudo systemctl status ssh

After checking, it was found that the error was error: kex protocol error:
To solve this problem, open the /etc/ssh/sshd_config configuration file and add the following code segment at the end

KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1

Then restart the ssh service. At this point, you can log in to ssh using your username, but root still cannot.

Enable root user

1. First Step

Log in to the system as a normal user, create a password for the root user, and 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)

Step 2

Modify the 50-ubuntu.conf file

Enter the command in the terminal: sudo vim /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

Step 3

Modify the gdm-autologin file

Enter the command in the terminal: sudo vim /etc/pam.d/gdm-autologin
Open the file and add # in front of it. Comment out the third line: auth required pam_succeed_if.so user != root quiet_success

Step 4

Modify the gdm-password file

Enter the command in the terminal: sudo vim /etc/pam.d/gdm-password Open the file and add # in front of it. Comment out the third line: auth required pam_succeed_if.so user != root quiet_success

Step 5

Modify the /root/.profile file. Enter the command in the terminal: sudo vim /root/.profile Open the file and modify the line mesg n 2> /dev/null || true at the end of the file to
tty -s&&mesg n || true
Finally, restart the server.

After the reboot, you can log in as root or as your username.

This is the end of this article about Ubuntu 20.04 desktop installation, root permission activation and ssh installation details. For more information about Ubuntu 20.04 root permissions and ssh, 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:
  • Use MySQL to open/modify port 3306 and open access permissions in Ubuntu/Linux environment
  • Ubuntu 18.04 obtains root permissions and logs in as root user
  • 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 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

<<:  Several ways to encapsulate breadcrumb function components in Vue3

>>:  MySQL parameter related concepts and query change methods

Recommend

Linux Basic Tutorial: Special Permissions SUID, SGID and SBIT

Preface For file or directory permissions in Linu...

Steps to solve the MySQL 8.0 time zone problem

Software Version Windows: Windows 10 MySQL: mysql...

Example of using setInterval function in React

This article is based on the Windows 10 system en...

Quickly solve the problem that the mysql57 service suddenly disappeared

one, G:\MySQL\MySQL Server 5.7\bin> mysqld --i...

Detailed explanation of the use of Vue Smooth DnD, a draggable component of Vue

Table of contents Introduction and Demo API: Cont...

MySQL5.7.21 decompressed version installation detailed tutorial diagram

Since I often install the system, I have to reins...

CSS implements 0.5px lines to solve mobile compatibility issues (recommended)

【content】: 1. Use background-image gradient style...

Summary of discussion on nginx cookie validity period

Every visit will generate Cookie in the browser, ...

Reasons and solutions for the failure of React event throttling effect

Table of contents The problem here is: Solution 1...

HTML Tutorial: DOCTYPE Abbreviation

When writing HTML code, the first line should be ...

Ubuntu installation cuda10.1 driver implementation steps

1. Download cuda10.1: NVIDIA official website lin...

WeChat applet realizes multi-line text scrolling effect

This article example shares the specific code for...

The vue project realizes drawing a watermark in a certain area

This article shares with you how to use Vue to dr...

Detailed steps to install Anaconda on Linux (Ubuntu 18.04)

Anaconda is the most popular python data science ...

Nginx learning how to build a file hotlink protection service example

Preface Everyone knows that many sites now charge...