Skip to content

Commit

Permalink
Fix SSH dial error (#413)
Browse files Browse the repository at this point in the history
Error message:
[Apr  2 13:36:49] DEBUG [localhost] Failed to Dial to u16, err: ssh: must specify HostKeyCallback, Retrying in 552.330144ms...

It is caused by breaking changes of Go library.
https://go-review.googlesource.com/c/38701/
  • Loading branch information
kotakanbe authored Apr 2, 2017
1 parent b33cd54 commit 9ab0622
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scan/executil.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ func getAgentAuth() (auth ssh.AuthMethod, ok bool) {
func tryAgentConnect(c conf.ServerInfo) *ssh.Client {
if auth, ok := getAgentAuth(); ok {
config := &ssh.ClientConfig{
User: c.User,
Auth: []ssh.AuthMethod{auth},
User: c.User,
Auth: []ssh.AuthMethod{auth},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
client, _ := ssh.Dial("tcp", c.Host+":"+c.Port, config)
return client
Expand All @@ -385,8 +386,9 @@ func sshConnect(c conf.ServerInfo) (client *ssh.Client, err error) {

// http://blog.ralch.com/tutorial/golang-ssh-connection/
config := &ssh.ClientConfig{
User: c.User,
Auth: auths,
User: c.User,
Auth: auths,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}

notifyFunc := func(e error, t time.Duration) {
Expand Down

0 comments on commit 9ab0622

Please sign in to comment.