1、使用 Google Cloud SSH 连接
2、 切换到 root 用户
sudo -i
3、 编辑ssh配置文件
vi /etc/ssh/sshd_config
修改以下值:
PermitRootLogin yes
PasswordAuthentication yes
4、重启ssh
systemctl restart sshd
sudo -i
vi /etc/ssh/sshd_config
修改以下值:
PermitRootLogin yes
PasswordAuthentication yes
systemctl restart sshd
Ubuntu 18.04的ssh版本中,root用户默认被禁止连接
需要编辑 /etc/ssh/sshd_config 文件
sudo vi /etc/ssh/sshd_config
找到PermitRootLogin,设为yes
PermitRootLogin yes
重启ssh服务
sudo systemctl restart ssh