I am trying to connect to a remote server using GoLang. In the client configuration, in addition to the user and password, I set HostKeyCallback to zero so that it accepts every host
config := &ssh.ClientConfig{
User: user,
HostKeyCallback: nil,
Auth: []ssh.AuthMethod{
publicKey,
},
}
But I keep getting this error.
Failed to dial: ssh: must specify HostKeyCallback
How to solve this?
source
share