环境: ubuntu20.04
1. ubuntu默认没有安装ssh的server,需要自己安装
sudo apt-get install openssh-server
2. 配置允许远程使用root账号ssh登入,修改/etc/ssh/sshd_config文件,
找到PermitRootLogin 去掉 #号prohibit-password改为yes
#PermitRootLogin prohibit-password
PermitRootLogin yes
3. 重启sshd
sudo systemctl enable sshd
4. 设置开机自启动
sudo systemctl enable sshd