I've been trying to connect to my VMs through Cloud Shell using the cloud command.
But every time I try it's giving me this error:
root@cs-551720538893-default:/home/user# gcloud compute ssh --zone "us-east4-a" "hostname" --tunnel-through-iap --project "project_id"
Writing 3 keys to /root/.ssh/google_compute_known_hosts
WARNING:
To increase the performance of the tunnel, consider installing NumPy. For instructions,
please see https://cloud.google.com/iap/docs/using-tcp-forwarding#increasing_the_tcp_upload_bandwidth
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:****************************************.
Please contact your system administrator.
Add correct host key in /root/.ssh/google_compute_known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/google_compute_known_hosts:3
remove with:
ssh-keygen -f "/root/.ssh/google_compute_known_hosts" -R "compute.***********"
ECDSA host key for compute.******** has changed and you have requested strict checking.
Host key verification failed.
Recommendation: To check for possible causes of SSH connectivity issues and get
recommendations, rerun the ssh command with the --troubleshoot option.
gcloud compute ssh hostname --project=projectId --zone=us-east4-a --troubleshoot
Or, to investigate an IAP tunneling issue:
gcloud compute ssh hostname --project=projectId --zone=us-east4-a --troubleshoot --tunnel-through-iap
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
root@cs-*******-default:/home/user#
Solved! Go to Solution.
Thanks for the reply but what helped me was, adding this flag --strict-host-key-checking=no to the gcloud command.