问题
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