hobby-kube / guide

Kubernetes clusters for the hobbyist.
MIT License
5.57k stars 258 forks source link

hcloud provider: ssh: unable to authenticate #59

Closed michaelbagrov closed 5 years ago

michaelbagrov commented 5 years ago

Hello,

Thank you for this project, it is awesome! But I run into problem I can't resolve. When trying to provision hcloud server it stuck on connecting to newly created server. Here is output of terraform:

module.provider.hcloud_server.host: Creating...
  datacenter:   "" => "<computed>"
  image:        "" => "ubuntu-16.04"
  ipv4_address: "" => "<computed>"
  ipv6_address: "" => "<computed>"
  ipv6_network: "" => "<computed>"
  keep_disk:    "" => "false"
  location:     "" => "nbg1"
  name:         "" => "node-1"
  server_type:  "" => "cx11"
  ssh_keys.#:   "" => "1"
  ssh_keys.0:   "" => "work"
  status:       "" => "<computed>"
module.provider.hcloud_server.host: Still creating... (10s elapsed)
module.provider.hcloud_server.host: Still creating... (20s elapsed)
module.provider.hcloud_server.host: Provisioning with 'remote-exec'...
module.provider.hcloud_server.host (remote-exec): Connecting to remote host via SSH...
module.provider.hcloud_server.host (remote-exec):   Host: 159.69.206.29
module.provider.hcloud_server.host (remote-exec):   User: root
module.provider.hcloud_server.host (remote-exec):   Password: false
module.provider.hcloud_server.host (remote-exec):   Private key: false
module.provider.hcloud_server.host (remote-exec):   SSH Agent: false
module.provider.hcloud_server.host (remote-exec):   Checking Host Key: false

.....

module.provider.hcloud_server.host: Still creating... (5m0s elapsed)
module.provider.hcloud_server.host: Still creating... (5m10s elapsed)
module.provider.hcloud_server.host (remote-exec): Connecting to remote host via SSH...
module.provider.hcloud_server.host (remote-exec):   Host: 159.69.206.29
module.provider.hcloud_server.host (remote-exec):   User: root
module.provider.hcloud_server.host (remote-exec):   Password: false
module.provider.hcloud_server.host (remote-exec):   Private key: false
module.provider.hcloud_server.host (remote-exec):   SSH Agent: false
module.provider.hcloud_server.host (remote-exec):   Checking Host Key: false
module.provider.hcloud_server.host: Still creating... (5m20s elapsed)

Error: Error applying plan:

1 error(s) occurred:

* module.provider.hcloud_server.host: timeout - last error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

as displayed above I'm passing work ssh key to ssh_keys of "hcloud_server" "host" resource, this key is also added to hetzner account and I can ssh to server. So it seems that remote-exec do not use key work.

I'm using 0.11.10 version of terraform and 1.4.0 of hcloud provider.

michaelbagrov commented 5 years ago

resolved by running ssh-add