Complete the code to add an SSH key to the instance metadata.
gcloud compute instances add-metadata my-instance --metadata ssh-keys=[1]The ssh-keys metadata key is used to add SSH public keys to an instance. The value must be in the format username:ssh-rsa ....
Complete the code to enable OS Login on a Compute Engine instance.
gcloud compute instances add-metadata my-instance --metadata enable-oslogin=[1]Setting enable-oslogin metadata to TRUE enables OS Login for the instance, allowing SSH access via IAM roles.
Fix the error in the command to remove SSH keys from instance metadata.
gcloud compute instances remove-metadata my-instance --keys=[1]The correct way to remove SSH keys is to remove the ssh-keys metadata key using gcloud compute instances remove-metadata <instance> --keys=ssh-keys.
Fill both blanks to create a metadata entry that disables project-wide SSH keys on an instance.
gcloud compute instances add-metadata my-instance --metadata [1]=[2]
enable-oslogin instead of block-project-ssh-keys.FALSE which does not block keys.Setting block-project-ssh-keys=TRUE disables the use of project-wide SSH keys on the instance.
Fill all three blanks to add a custom SSH key metadata entry with a username and key.
gcloud compute instances add-metadata my-instance --metadata [1]=[2]:[3]
enable-oslogin as the metadata key.The metadata key is ssh-keys. The value format is username:ssh-rsa ... to add an SSH public key for the user.