Specify InsecureIgnoreHostKey for HostKeyCallback

[A recent breaking change upstream in Golang's crypto
library](e4e2799dd7)
has broken SSH connectivity for a few builders:

```
==> qemu: Waiting for SSH to become available...
2017/05/20 16:23:58 ui: ==> qemu: Waiting for SSH to become available...
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 [INFO] Attempting SSH connection...
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 reconnecting to TCP connection for SSH
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 handshaking with SSH
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 handshake error: ssh: must specify HostKeyCallback
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 [DEBUG] SSH handshake err: ssh: must specify HostKeyCallback
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 [INFO] Attempting SSH connection...
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 reconnecting to TCP connection for SSH
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 handshaking with SSH
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 handshake error: ssh: must specify HostKeyCallback
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 [DEBUG] SSH handshake err: ssh: must specify HostKeyCallback
```

Specifying HostKeyCallback as insecure should make things work again
and would make sense for packer's use case.
This commit is contained in:
JD Friedrikson 2017-05-20 16:17:04 -04:00
parent 740f438639
commit a0052fdb68
No known key found for this signature in database
GPG Key ID: E113967DDD441EEC
7 changed files with 19 additions and 12 deletions

View File

@ -42,8 +42,9 @@ func SSHConfigFunc(config *SSHConfig) func(multistep.StateBag) (*gossh.ClientCon
}
return &gossh.ClientConfig{
User: config.Comm.SSHUsername,
Auth: auth,
User: config.Comm.SSHUsername,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}
}

View File

@ -50,6 +50,7 @@ func SSHConfig(username string, password string, privateKeyFile string) func(mul
gossh.KeyboardInteractive(
ssh.PasswordKeyboardInteractive(password)),
},
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}
}

View File

@ -41,7 +41,8 @@ func sshConfig(state multistep.StateBag) (*gossh.ClientConfig, error) {
auth = append(auth, gossh.PublicKeys(signer))
}
return &gossh.ClientConfig{
User: config.Comm.SSHUsername,
Auth: auth,
User: config.Comm.SSHUsername,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}

View File

@ -41,7 +41,8 @@ func sshConfig(state multistep.StateBag) (*gossh.ClientConfig, error) {
auth = append(auth, gossh.PublicKeys(signer))
}
return &gossh.ClientConfig{
User: config.Comm.SSHUsername,
Auth: auth,
User: config.Comm.SSHUsername,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}

View File

@ -35,7 +35,8 @@ func sshConfig(state multistep.StateBag) (*gossh.ClientConfig, error) {
}
return &gossh.ClientConfig{
User: config.Comm.SSHUsername,
Auth: auth,
User: config.Comm.SSHUsername,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}

View File

@ -36,8 +36,9 @@ func SSHConfigFunc(config SSHConfig) func(multistep.StateBag) (*gossh.ClientConf
}
return &gossh.ClientConfig{
User: config.Comm.SSHUsername,
Auth: auth,
User: config.Comm.SSHUsername,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}
}

View File

@ -84,8 +84,9 @@ func SSHConfigFunc(config *SSHConfig) func(multistep.StateBag) (*gossh.ClientCon
}
return &gossh.ClientConfig{
User: config.Comm.SSHUsername,
Auth: auth,
User: config.Comm.SSHUsername,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}
}