Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 741
red888 Avatar asked Jan 28 '18 14:01

red888


People also ask

What is GCloud Auth activate-service-account?

gcloud auth activate-service-account authorizes access using a service account. As with gcloud init and gcloud auth login, this command saves the service account credentials to the local system on successful completion and sets the specified account as the active account in your Cloud SDK configuration. To authorize using a service account:

How to authorize using a service account in Google Cloud SDK?

As with gcloud init and gcloud auth login, this command saves the service account credentials to the local system on successful completion and sets the specified account as the active account in your Cloud SDK configuration. To authorize using a service account: Go to the Service Accounts page in the Google Cloud Console.

How to authorize access to GCloud without performing other setup steps?

To authorize access without performing other setup steps: 1 Run gcloud auth login:#N#gcloud auth login#N#Or:#N#gcloud auth login --no-launch-browser#N#You can use the --no-launch-browser... 2 Follow the browser-based authorization flow to authenticate the account and grant access permissions. More ...

What is a Google Cloud service account?

A service account is a Google Cloud account associated with your Google Cloud project and not a specific user. To have your application use a service account, you provide a service account key to your application.


1 Answers

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.

like image 120
Zachary Newman Avatar answered Sep 25 '22 21:09

Zachary Newman