我正在使用 gcloud ssh 连接 gce。
> gcloud compute --project "first-medium-2****8" ssh --zone "us-east1-b" "instance-2"
我在powershell中输入了上面的命令,但是它回复了
>Using username "hogehoge".
>Authenticating with public key "DESKTOP-****hogehoge"
然后停下来。毕竟什么也没发生。
昨天我做了同样的事情,没有问题。
但是今天,我不能。我尝试了 gcloud init 并重新安装了 gcloud。
但是什么都没有改变。我应该怎么做才能解决这个问题?
附加信息。
操作系统 Windows10
谷歌云 SDK 237.0.0
PowerShell 5.1.17134.590
Putty 0.70(只安装一次)
注意 1:我发现我可以毫无问题地使用 Cloud Shell。 但是,cloud shell 有超时。所以我更喜欢 gcloud 而不是 cloud shell。
注意 2:当我使用 cloudshell 时,它连接为“tomotomo”。 不是我使用 gcloud 时的用户名“hogehoge”。
当我运行“gcloud compute ssh VM_NAME --verbosity=debug --log-http”时
它回复
>DEBUG: SSH Known Hosts File [C:\Users\hogehoge\.ssh\google_compute_known_hosts] could not be opened: Unable to read file
[C:\Users\hogehoge\.ssh\google_compute_known_hosts]: [Errno 2] No such file or directory: u'C:\\Users\\hogehoge\\.ssh\\goo
gle_compute_known_hosts'
DEBUG: Current SSH keys in project: [u'tomotomo:ssh-rsa AAAAB***
DEBUG: Running command [C:\Users\hogehoge\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\sdk\putty.exe -t -i C:\User
s\hogehoge\.ssh\google_compute_engine.ppk hogehoge@3*****].
DEBUG: Executing command: [u'C:\\Users\\hogehoge\\AppData\\Local\\Google\\Cloud SDK\\google-cloud-sdk\\bin\\sdk\\putty.ex
e', u'-t', u'-i', u'C:\\Users\\hogehoge\\.ssh\\google_compute_engine.ppk', u'hogehoge@3*****']
很长,所以我只摘录了我认为重要的部分。
最佳答案
运行
putty -cleanup
解决了这个问题。
Putty在注册表中保存了一些信息(IP地址,公钥等)
此命令删除那些注册表和随机种子文件。
关于google-cloud-platform - gcloud compute ssh 停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55073660/