Issue
When running gcloud beta compute ssh --zone xxx --internal-ip --project xxx xxx
I am getting the following error but some of my colleagues work just fine and ssh in without any issue.
Existing host keys found in /Users/xxx/.ssh/google_compute_known_hosts
ERROR: (gcloud.beta.compute.ssh) [/usr/bin/ssh] exited with return code [255].
May I ask what can be the reason causing this and what can I do to resolve the problem?
Solution
This means that a host with the same IP address but with a different fingerprint was found in the known hosts file. This can happen when you create and delete instances and the same external public IP address is used for the VM instance. The fingerprint will be different for the new host (VM instance).
Edit the file /Users/xxx/.ssh/google_compute_known_hosts
, find the entry for the VM's IP address and remove the entry.
Answered By - John Hanley Answer Checked By - Mary Flores (WPSolving Volunteer)