Open
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
1.8.3
Does this issue reproduce with the latest release?
https://github.com/golang/crypto.git
commit : 614d502
What operating system and processor architecture are you using (go env
)?
centos 7
What did you do?
auth := make([]ssh.AuthMethod, 0)
auth = append(auth, ssh.Password("123456"))
config := &ssh.ClientConfig {
User: "root",
Auth: auth,
HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error {
return nil
},
Timeout: 30 * time.Second,
}
for i:=0;i<2;i++ {
go func() {
client, err := ssh.Dial("tcp", "ip:port", config)
fmt.Println(err) // the 2th thread (maybe 3th or other litter value) will error
time.Sleep(5 * time.Second)
// error is not here, it just a test code
client.Close()
}()
}
What did you expect to see?
run pass
What did you see instead?
ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remainthe second thread error , other machines maybe 3 or ...