SSH无法连接到Google Cloud

时间:2016-04-14 07:48:34

标签: ssh google-cloud-platform

所以,我只是试用GCloud服务,并尝试通过ssh连接。我第一次忘记了Mac的用户名,所以我做错了:

doe-MacBook-Pro:Documents does$ ssh -i ~/.ssh/google_compute_engine xxxx@111.111.111.111
Warning: Identity file /Users/does/.ssh/google_compute_engine not accessible: No such file or directory.
The authenticity of host '111.111.111.111 (111.111.111.111)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '111.111.111.111' (ECDSA) to the list of known hosts.
Permission denied (publickey).

然后我知道我的用户名,我试过了:

doe-MacBook-Pro:Documents does$ ssh -i ~/.ssh/google_compute_engine does@111.111.111.111
Warning: Identity file /Users/does/.ssh/google_compute_engine not accessible: No such file or directory.
Permission denied (publickey).

它给了我错误。你能告诉我怎样才能解决这个问题?

2 个答案:

答案 0 :(得分:1)

这与ssh用户名无关。 首先检查两件事,我们可以从那里开始:

  1. 许可:您应该可以阅读,即至少0400。
  2. 文件:它是否存在?

答案 1 :(得分:0)

问题解决了!

我忘了没有完成我的$scope.$watchCollection('items', function(array) { if (array) { $scope.total = array.reduce(function(total,item) { return total + item.preco; },0); } }); 命令。 完成命令后,它会创建文件gcloud compute ssh project-name。 现在我终于可以通过SSH连接到我的Google Cloud。