Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save newrerio/f0da6c0f67be280b7f1155953a4bfb3c to your computer and use it in GitHub Desktop.
Save newrerio/f0da6c0f67be280b7f1155953a4bfb3c to your computer and use it in GitHub Desktop.

使用SSH方式登录谷歌云服务器

通过网页端登录Google Cloud

切换到root用户

sudo su

修改root密码

passwd
# Changing password for user root.
# New password:新密码
# Retype new password:重新录入新密码
# passwd: all authentication tokens updated successfully.

修改ssh配置

Google Cloud默认是不允许用ssh远程登录

vim /etc/ssh/sshd_config

按如下规则修改配置

PermitRootLogin yes # 默认为: PermitRootLogin no
PasswordAuthentication yes #默认为: PasswordAuthentication no

重启ssh服务

service sshd restart

使用ssh等第三方工具登录Google Cloud

    ssh root@ip_address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment