1.進入谷歌雲實例面板
2.切換到root角色
sudo -i
3.修改SSH配置文件/etc/ssh/sshd_config
vi /etc/ssh/sshd_config
修改PermitRootLogin和PasswordAuthentication為yes
# Authentication:
PermitRootLogin yes //默認為no,需要開啟root用戶訪問改為yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes //默認為no,改為yes開啟密碼登陸
4.給root用戶設置密碼
passwd root
5.重啟SSH服務使修改生效
/etc/init.d/ssh restart
6.登錄
在xshell中,直接使用root賬號密碼登錄。