2016-04-25 96 views
0

我在Google Compute Engine上創建了一個實例,但似乎無法使用終端進行SSH。我使用的命令是:通過Mac OS X終端登錄Google Compute Engine實例

 
gcloud compute ssh example-instance 

,我得到的錯誤是:

 
ERROR: (gcloud.compute.ssh) Could not SSH to the instance. It is possible that your SSH key has not propagated to the instance yet. Try running this command again. If you still cannot connect, verify that the firewall and instance are set to accept ssh traffic. 

當我用Google搜索的錯誤,我被帶到了這個鏈接:Unable to SSH to Google Cloud

我去檢查過了這裏的防火牆規則https://cloud.google.com/compute/docs/troubleshooting#ssherrors和事情似乎很好。我也去了〜/ .ssh並檢查了google_compute_engine和google_compute_engine.pub,它們表明我的私鑰和公鑰存在。我在想我下一步該做什麼?這是否是Mac工作站特有的問題?

任何幫助將非常感激。

+0

我建議還要通過故障排除[這裏](https://cloud.google.com/compute/docs/ssh-in-browser#ssherror)。這是關於從瀏覽器進行SSH連接的,但許多原因也適用於'gcloud compute ssh'。 –

回答

0

這裏有一些其他的事情要檢查:

  • 你可以ssh到該實例從瀏覽器,在Cloud Console使用「SSH」按鈕?
  • 如果不是,請使用默認設置嘗試新創建的實例,並比較example-instance的不同之處。
  • 運行gcloud config list並確認項目,帳戶,區域和區域的值符合您的預期。
相關問題