-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/ssh: can not open session to huawei CE5810 switch (got error "ssh: short read") #23058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If I use python netmiko library to connect the same Huawei CE5810 switch it's very OK.
|
Can you try without specifying a cipher list? |
Hi, if connect to the switch without specifying a cipher list, I got a error: ssh: handshake failed: ssh: no common algorithm for client to server cipher; client offered: [], server offered: [aes256-cbc aes128-cbc 3des-cbc aes256-cbc des-cbc].
The follows is a analysis for function Unmarshal() which is called by function Client():
|
@rasky Hi rasky. How long can this bug be fixed. I have more than 200 CE5810 switches to connect. We need your help. |
/cc @hanwen |
can you try to get a debug dump of both the python code and the golang one? There is a debugHandshake var you can set. I suspect the python code is using a different kex algorithm. |
@duhaifeng also, if you could expose one of those devices on a public IP address without security concerns, that would also help debugging. |
@rasky Thanks rasky. I asked my leader to bind a public IP for the switch. But he told me it's insecurity and refused my request. Now I'm trying to compare the go and python code to find the problem. The bad thing is when I updated the python netmiko lib to Version 2.0 it throws an error too. I'm rolling back the python lib version to get the right kex algorithm. If I made it I will upload the code as soon as quickly. |
you could try to set different values for config.KeyExchanges and see if there is any algorithm that works for you. the algorithms supported are listed here: https://go.googlesource.com/crypto/+/d585fd2cc9195196078f516b69daff6744ef5e84/ssh/kex.go#20 I suspect you are trying to use dh group14 now and your device only works with dh group1. |
Sorry. All of the algorithms can not work, the switch returns an error: "SSH Dial err: ssh: handshake failed: ssh: no common algorithm for client to server cipher; client offered: [], server offered: [aes256-cbc aes128-cbc 3des-cbc aes256-cbc des-cbc] " . If I use [aes256-cbc aes128-cbc 3des-cbc aes256-cbc des-cbc] then short read error again. |
Hi, @rasky , i have the same problem as duhaifeng , and i have a public IP to reappear this. code
|
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.9.2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?windows / amd64 (MacOS also)
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Sample code as follows:
What did you expect to see?
No error
What did you see instead?
When dial to Huawei CE5810 switch the connection can not be created.
The function ssh.Dial() always returns a error "handshake failed: ssh: short read".
I have set debugMux=true but no any more output.
I found that this error was output in function handshakeTransport.readOnePacket(first=true) {err = <-kex.done}
The text was updated successfully, but these errors were encountered: