gcloud auth activate-service-account是否需要访问.ssh文件夹?

时间:2018-01-28 14:45:56

标签: google-cloud-platform gcloud gcp

我运行gcloud auth activate-service-account --key-file=pathtokey

然后我跑:

gcloud compute scp sdfsdfsdfsdf.txt myinst:/tmp --zone us-east1-b

我收到了这个错误:

WARNING: The PuTTY PPK SSH key file for gcloud does not exist.
WARNING: The public SSH key file for gcloud does not exist.
WARNING: The private SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
open C:\Windows\system32\config\systemprofile\.ssh\google_compute_engine: The system cannot find the path specified.

我不明白,为什么它需要访问.ssh我只是给了它通往密钥的路径

1 个答案:

答案 0 :(得分:2)

服务帐户密钥与用于实例的 SSH密钥之间存在差异。

服务帐户密钥可让您访问GCP。您需要它来设置SSH密钥。

SSH密钥允许您登录特定实例。如果您具有GCP访问权限(例如,通过服务帐户密钥),则只能设置一个。但SSH程序通过SSH密钥工作,因此您需要一个设置。

您可以使用--ssh-key-file标志更改写入SSH密钥的位置。有关详细信息,请参阅documentation for gcloud compute ssh

相关问题