Install the ubuntu22.04 system, configure domestic sources and ssh remote login

1. Install ubuntu22.04 system

Original link: Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_wx63f86e949a470's technology blog_51CTO blog

1. Click Start this virtual machine on the left side of the interface to enter the Ubuntu operating system installation interface. Click Try or Install Ubuntu to start the installation.

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_Ubuntu_17

2. After entering the following installation interface, pull down the selection box on the left and select Simplified Chinese to facilitate our subsequent installation, and then click Install Ubuntu

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_system installation_18

3. The default setting here is Chinese, click to continue.

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_VMware_19

4. The default is normal installation. If there is low demand, you can choose minimal installation, which can also save computer resources.

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_VMware_20

5. Select here to clear the entire disk and install Ubuntu by default, click Install Now

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_VMware_21

6. Click here to continue

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_Ubuntu_22

7. For domestic network installation, the default location is Shanghai, click to continue.

8. Account settings, you can set your name, computer name, user name, login password, etc. according to your personal habits. After setting, click to continue.

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_system installation_23

9. Next, wait for the system to be installed.

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_VMware_24

10. Restart the system after installation is complete

11. After restarting, enter the password to enter the system. The interface is as follows

Ubuntu operating system version 22.04 installation tutorial-VMware virtual machine_Ubuntu_26

 2. Configure the root account

1. Modify the root account password. First enter the normal user password, and then set the root password. Enter it twice:

$ sudo passwd root

 3. Configure IP address

1. First use ip a to check the computer’s network card information:

 $ su - switch to root account

# ip a shows that the network card name is ens33

2. Enter sudo vim /etc/netplan/01-network-manager-all.yaml, edit the yaml file, and configure the network card information as follows

# Let NetworkManager manage all devices on this system
network:
  ethernets:
    ens33:
      addresses: [192.168.184.129/24]
      gateway4: 192.168.184.2
      dhcp4: false
      nameservers:
          addresses : [114.114.114.114]
  version: 2
  renderer: networkd
according to actual needs Set the static IP address, gateway, and DNS of the enp3s0 network card in sequence, set dhcp4 to false, and add: renderer: networkd in the last line. Pay attention to the indentation alignment, and each colon must be followed by a space, otherwise there will be problems. After setting, save and exit

3. Enter the command netplan apply to make the configuration take effect, or reboot to restart the system.

 # netplan apply

4. Replace Alibaba Cloud Source

First copy source.list as source.list.bak backup.

# cp /etc/apt/sources.list  /etc/apt/sources.list.bak

# vim /etc/apt/sources.list

deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

This article is a list of Alibaba Cloud image sources for Ubuntu 22.04. If it is another version, just change all jammy to other version codenames.
Commonly used Ubuntu version codenames are as follows:
Ubuntu 22.04: jammy
Ubuntu 20.04: focal
Ubuntu 18.04: bionic
Ubuntu 16.04: xenia

After the modification is completed, save the source.list file. You need to execute the command to take effect.

# sudo apt update

5. Configure ssh so that root can log in remotely

Install ssh service

# apt install -y openssh-server

# systemctl start sshd Start service

# update-rc.d ssh enable ssh service starts automatically at boot

Configure root to log in remotely, modify the following configuration content, save and exit

# vim /etc/ssh/sshd_config

PermitRootLogin yes

PasswordAuthentication yes

# systemctl restart sshd Restart to take effect

Guess you like

Origin blog.csdn.net/weixin_42272246/article/details/132234273