Welcome to the lab guide for Cloud Academy's Hands-on Lab, Connect to Google Compute Engine (GCE) Linux VM Instances Using SSH!
Connecting to a VM using an SSH connection in GCP requires you to copy and paste a key at the very end of this lab. However, due to different browser and operating systems clipboard management, extra blank spaces can appear when you paste the key. Below, you'll find the steps that explain how to copy the key, paste it into the correct field, and double-check for the blank white spaces.
Go to compute engine and make sure you are editing the correct instance:
Go back to the Linux shell for ca-lab-vm and enter this command: more ~/.ssh/ca-lab_key.pub
Again, make sure you are on the correct terminal:
Once you enter the command, the token will populate. Please be advised that when the public key is copied from the terminal, it is already in the proper format (<protocol> <key-blob> <email@example.com>), however, it will have nearly 3 extra blank spaces in it that you need to remove.
This is what the space should look like.
The only spaces that should be left are between "ssh-rsa" the start of the key blob, the end of the key blob and "centos."
Please be careful that only the spaces in the key blob were removed and not the characters.
Once you removed the unnecessary spaces, the error will go away:
6) Click save, and it should pass the validation check:
The next step is a summary, and you can just click submit to finish the lab:
Now you know how to remove the extra blank spaces if you're running into the key error! If you continue to encounter any issues after removing the spaces from the key blob, or if you have any other questions or concerns, please email firstname.lastname@example.org