gcloud auth activate-service-account needs access to .ssh folder?

允我心安 提交于 2020-01-04 02:39:09

问题


I run gcloud auth activate-service-account --key-file=pathtokey

then I run:

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

And I get this error:

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.

i don't understand, why it need access to .ssh I just gave it the path to the key


回答1:


There's a difference between the service account key and the SSH key used for an instance.

The service account key lets you access GCP. You need it to set up an SSH key.

The SSH key lets you log into a particular instance. You can only set one up if you have GCP access (for instance, via a service account key). But the SSH program works via SSH keys, so you'll need one set up.

You can change the location where the SSH key is written using the --ssh-key-file flag. See the documentation for gcloud compute ssh for more information.



来源:https://stackoverflow.com/questions/48487573/gcloud-auth-activate-service-account-needs-access-to-ssh-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!