Hello,
I'm working on a utility that uses the golang.org/x/crypto/ssh library to
connect to about 100 servers. Most of the connections work fine, but there
are 6 servers where the connection hangs during the ssh.Dial. Using delve,
I've been able to track it down to clientAuthenticate in client_auth.go,
specifically line 20 in the current source:
packet, err := c.transport.readPacket()
As soon as execution reaches this line, it hangs indefinitely.
The servers all have different versions of OpenSSH, and servers that work
have the same versions as the servers that don't. If I use "ssh
username@server" from the command line in linux, or try to SSH in using
putty in Windows, I can connect with no problems.
I can reproduce the same problem with this program:
package main
import (
"fmt"
"log"
"golang.org/x/crypto/ssh"
)
func main() {
config := &ssh.ClientConfig{
User: "username",
Auth: []ssh.AuthMethod{
ssh.Password("password"),
},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
client, err := ssh.Dial("tcp", "server:22", config)
if err != nil {
log.Fatal("Failed to dial: ", err)
}
client.Close()
fmt.Println("Done")
}
Is there something wrong in my code, could it be a configuration problem on
these servers, or is there a bug?
I'm using go1.8.3 windows/amd64 and also cross compiling for linux/amd64.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.