From de249293a289ac939b5bb3af357e5c55f35b7757 Mon Sep 17 00:00:00 2001 From: Maciej Zimnoch Date: Fri, 13 Dec 2019 11:56:08 +0100 Subject: [PATCH] ssh: Specify HostKeyCallback in ClientConfig Since https://github.com/golang/go/issues/19767 SSH library requires this field on each connection. Currently all new installations of sup via `go get` doesn't work at all. This commit fixes it. --- ssh.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssh.go b/ssh.go index eb3cefb..e84bf60 100644 --- a/ssh.go +++ b/ssh.go @@ -139,6 +139,9 @@ func (c *SSHClient) ConnectWith(host string, dialer SSHDialFunc) error { Auth: []ssh.AuthMethod{ authMethod, }, + HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error { + return nil + }, } c.conn, err = dialer("tcp", c.host, config)