Closed serafeimgr closed 2 years ago
Not a bug added the following and it works as expected
uri = "qemu+ssh://root:${var.ssh_password}@${var.host_ip_address}/system?sshauth=ssh-password&known_hosts_verify=ignore"
Ignoring the known_hosts file isn't really a proper solution here. The problem appears to be that the known_hosts file isn't being read properly.
uri = "qemu+ssh://non_root_libvirt_user>@<ip/system?keyfile=/home/user/.ssh/id_rsa"
│ Error: failed to dial libvirt: ssh: handshake failed: knownhosts: key mismatch
│
│ with provider["registry.terraform.io/dmacvicar/libvirt"],
│ on simple.tf line 8, in provider "libvirt":
│ 8: provider "libvirt" {
Glancing through https://github.com/dmacvicar/terraform-provider-libvirt/blob/main/libvirt/uri/ssh.go
Isn't returning properly? I can ssh to the same host with no key mismatch, using the same default id_rsa key, and known_hosts file, so something strange is happening.
I found this, I might poke at it later. https://cyruslab.net/2020/10/23/golang-how-to-write-ssh-hostkeycallback/
System Information
Linux distribution
Ubuntu
Terraform version
Provider and libvirt versions
Checklist
Description of Issue/Question
Setup
Steps to Reproduce Issue
Additional information:
Do you have SELinux or Apparmor/Firewall enabled? Some special configuration?
firewall is not enabled
Have you tried to reproduce the issue without them enabled?