Google Cloud禁用了ssh登录功能,使用默认的秘钥进行登录,也可以在Web后台使用console端口进行登录,但是对于习惯了本地ssh登录的用户而言,还是显得比较麻烦。
1.切换到root账户修改默认密码
sudo su
sudo passwd
2. 开启ssh登录接口
编辑ssh配置文件
vim /etc/ssh/sshd_config
修改以下的内容
PermitRootLogin yes
PasswordAuthentication yes
GCP上ubuntu 18.04以上的版本已经默认关闭了22端口,这里也需要打开。

Matrixinfo | Google Cloud SSH登录
重启ssh
service sshd restart