本地连接google cloud shell

招晓贤

招晓贤

AI engine @ Facebook

google cloud shell 经常断线,所以我们可以尝试用本地ssh连接google cloud shell

step1

gcloud alpha cloud-shell ssh

png

step2 按照系统要求按照密钥

png

step3 连接成功

png

step4 如果连接失败,可能的原因是gcloud的设置

1 我们可以重新安装SDK 2 对gcloud 初始化, 重新设置project, account 3 重新走step1

具体:

./google-cloud-sdk/install.sh #重新安装SKD后,重新开启终端
gcloud init 初始化 SDK
To continue, you must log in. Would you like to log in (Y/n)? Y
Pick cloud project to use:
[1] [my-project-1]
[2] [my-project-2]
...
Please enter your numeric choice:
Which compute zone would you like to use as project default?
[1] [asia-east1-a]
[2] [asia-east1-b]
...
[14] Do not use default zone
Please enter your numeric choice:
gcloud has now been configured!
You can use [gcloud config] to change more gcloud settings.
Your active configuration is: [default]
gcloud config set accessibility/screen_reader true