Hello,
with the most recent version of CoreOS, 33.20210117.3.2, I cannot use the terraform ssh connection provisioner anymore. It used to work in prior versions.
Problem is that a SSH connection cannot be established by means of the tf connector, but it works with a simple “ssh core@”. Here are two log entries, acquired with journalctl while trying to login with either method:
When trying with terraform connector (failure):
Feb 13 14:27:10 k1.local.vlan audit[18899]: USER_LOGIN pid=18899 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=login acct="core" exe="/usr/sbin/sshd" hostname=? addr=192.168.56.1 terminal=ssh res=failed'
When trying with “ssh core@…” (success):
Feb 13 14:29:00 k1.local.vlan audit[20006]: USER_LOGIN pid=20006 uid=0 auid=1000 ses=12 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=login id=1000 exe="/usr/sbin/sshd" hostname=? addr=192.168.56.1 terminal=/dev/pts/1 res=success'
The user is in both cases the same (core) and ssh is via RSA pub key from ssh-agent. Here is a simple terraform module to reproduce the case:
resource "null_resource" "copy" {
connection {
type = "ssh"
host = "<some coreos host>"
user = "core"
timeout = "10m"
agent = true
}
provisioner "file" {
content = "blabla"
destination = "ttt"
}
}
when running “terraform init” and “terraform apply”, the apply hangs for 10min and then dies. It works for any other host, which is not CoreOS.
When setting the TF_LOG to TRACE, there is a related message:
SSH authentication failed (core@k1.local.vlan:22): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Terraform version is 0.13 or 0.14, I have the issue with both.
Is there anything possibly wrong on my side or is this a bug?