googlecodelabs / feedback

Provide feedback to our codelabs by filing an issue here
18 stars 22 forks source link

[cloud-compute-the-cosmos]: Lab error when trying to ssh #276

Open morrisfury opened 6 years ago

morrisfury commented 6 years ago

After step 7 when trying to ssh to my vm instance in step 8 I receive the error below:

morris@my-compute-engine-codelab-1234567890:~$gcloud compute ssh codelab-node 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. This tool needs to create the directory [/home/morris/.ssh] before being able to generate SSH keys. Do you want to continue (Y/n)? y Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/morris/.ssh/google_compute_engine. Your public key has been saved in /home/morris/.ssh/google_compute_engine.pub. The key fingerprint is: xxx The key's randomart image is: xxx Updating project ssh metadata.../Updated [https://www.googleapis.com/compute/v1/projects/my-compute-engine-codelab-1234567890]. Updating project ssh metadata...done. Waiting for SSH key to propagate. Warning: Permanently added 'compute.xxxx' (ECDSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic). ERROR: (gcloud.compute.ssh) Could not SSH into the instance. It is possible that your SSH key has not propagated to the instance yet. Try running this command again. If you still cannot connect, verify that the firewall and instance are set to accept ssh traffic. morris@my-compute-engine-codelab-1234567890:~$ gcloud compute ssh codelab-node Permission denied (publickey,gssapi-keyex,gssapi-with-mic). ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255]. morris@my-compute-engine-codelab-1234567890:~$ gcloud compute ssh codelab-node Permission denied (publickey,gssapi-keyex,gssapi-with-mic). ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

Firewall is set correct (default-allow-ssh Apply to all
IP ranges: 0.0.0.0/0 tcp:22
Allow 65534 default)

morrisfury commented 6 years ago

Ok, seems I fixed this.

I removed the ssh key from GCP panel and reset the vm instance. I then re-ran "gcloud compute ssh codelab-node" and this time did not provide a passphrase. It seems my mistake was providing the passphrase.