解决 Ubuntu 18.04 root用户无法连接或登录ssh

Ubuntu 18.04的ssh版本中,root用户默认被禁止连接

需要编辑 /etc/ssh/sshd_config 文件

sudo vi /etc/ssh/sshd_config

找到PermitRootLogin,设为yes

PermitRootLogin yes

重启ssh服务

sudo systemctl restart ssh