一、在gcp的VM管理界面,点击红框里的SSH

二、输入sudo -i 切换到root用户
三、修改ssh配置文件
命令:
vi /etc/ssh/sshd_config
修改下面两个参数把no改为yes
PermitRootLogin no
PasswordAuthentication no
重启ssh服务与查看状态:
systemctl restart sshd.service
systemctl status sshd.service

四、给root账户添加密码,
命令:
passwd root
大功告成。
网友评论