[1] install ssh
18.04
apt install openssh-server
16.04
apt-get install openssh-server
[2] change the root password of Ubuntu
The root password should be changed first, because the default installation is not a fixed root password
Switch to root user
sudo su
Change the password of the root user
passwd
Enter the root password twice
[3] modify the ssh configuration file
Find file
/etc/ssh/sshd_config
Find the place below the configuration file
PermitRootLogin prohibit-password
change into
PermitRootLogin yes
[4] restart the ssh service
service sshd restart