Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5a7597

Browse files
author
andesli
committed
fix ssh: must specify HostKeyCallback erro
1 parent 37eb7ad commit d5a7597

File tree

9 files changed

+4
-0
lines changed

9 files changed

+4
-0
lines changed

bin/386/linux/gossh

59 Bytes
Binary file not shown.

bin/386/linux/passtool

0 Bytes
Binary file not shown.

bin/386/windows/gossh.exe

1 KB
Binary file not shown.

bin/386/windows/passtool.exe

0 Bytes
Binary file not shown.

bin/amd64/linux/gossh

67 Bytes
Binary file not shown.

bin/amd64/linux/passtool

0 Bytes
Binary file not shown.

bin/amd64/windows/gossh.exe

512 Bytes
Binary file not shown.

bin/amd64/windows/passtool.exe

0 Bytes
Binary file not shown.

machine/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"gossh/scp"
2828
"gossh/tools"
2929
"io"
30+
"net"
3031
"os"
3132
"path"
3233
"path/filepath"
@@ -441,6 +442,9 @@ func (server *Server) getSshClient() (client *ssh.Client, err error) {
441442
sshConfig := &ssh.ClientConfig{
442443
User: server.User,
443444
Auth: authMethods,
445+
HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error {
446+
return nil
447+
},
444448
}
445449
//psw := []ssh.AuthMethod{ssh.Password(server.Psw)}
446450
//Conf := ssh.ClientConfig{User: server.User, Auth: psw}

0 commit comments

Comments
 (0)