L0t
L0t

Reputation: 61

Can't connect to gcloud compute via ssh

I have instance in Google Cloud Platform's Compute Engine. My goal is to connect to this instance via ssh command or putty. Following this instruction (except Ansible part) https://alex.dzyoba.com/blog/gcp-ansible-service-account/ But when I try to connect via

ssh -i genereated-key <username of service account>@<external ip>

it gives me

Host key verification failed.

or

I also tried to use keys, which were genereated by google, but no difference

Compute Firewall's rules are:

NAME                    NETWORK  DIRECTION  PRIORITY  ALLOW                         DENY  DISABLED
default-allow-http      default  INGRESS    1000      tcp:80                              False
default-allow-https     default  INGRESS    1000      tcp:443                             False
default-allow-icmp      default  INGRESS    65534     icmp                                False
default-allow-internal  default  INGRESS    65534     tcp:0-65535,udp:0-65535,icmp        False
default-allow-rdp       default  INGRESS    65534     tcp:3389                            False
default-allow-ssh       default  INGRESS    65534     tcp:22                              False

What should I do to connect to instance via ssh ?

Upvotes: 0

Views: 224

Answers (1)

L0t
L0t

Reputation: 61

It turns out, that you cannot login via Putty/ssh using OS Login (at least support agent told me that). So In my case I added public key in instance settings (insted of metadata) and it works.

Upvotes: 0

Related Questions