1 Change network configuration information
Modify /etc/netplan/01-network-manager-all.yaml file information
sudo gedit /etc/netplan/01-network-manager-all.yaml
Delete the original content and replace it with the following information:
Note: addresses and gateway4 should be modified according to the actual situation of the personal virtual machine
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
addresses: [192.168.75.136/22]
optional: true
gateway4: 192.168.75.2
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
Enter the command to make the configuration just take effect
sudo netplan apply
Enter the ifconfig command to view the modified IP address
2 Ubuntu 20.04 initialize root password
Log in to the system as an ordinary user and create a password for the root user
sudo passwd root
Then enter the set password and enter it twice
3 Ubuntu 20.04 server configuration
Install the server service package
sudo apt update
sudo apt install openssh-server
open ssh service
sudo systemctl enable ssh
Check the running status of the ssh service (default port 22)
sudo systemctl status ssh
If it shows running, it is already running
Make sure the firewall allows the service port
sudo ufw allow ssh
Make sure the firewall allows the service port
sudo ufw allow ssh
4 Open the Xshell connection
slightly