Houman
Houman

Reputation: 66390

How to SSH into compute-engine?

Coming from AWS to Google Compute Engine, I find it very confusing through how many hoops I have to jump to get a simple SSH working.

I have added my public key cat ~/.ssh/id_rsa.pub

enter image description here

but I still can't ssh into it. Is there any other step or firewall settings I have to enable first?

Upvotes: 0

Views: 429

Answers (1)

David
David

Reputation: 9731

Just like gcloud compute ssh there is also a gcloud compute scp command.

Both of these commands are just adding the key to the project-wide metadata (which is downloaded by a daemon running on your instances) and then call ssh or scp. The keys that gcloud generate are stored in ~/.ssh/google_compute_engine, so you can directly use scp or ssh if you want like:

ssh -i ~/.ssh/google_compute_engine houmie@INSTANCE_IP

Upvotes: 1

Related Questions