How to track an issue with SSH and docker containers

asked 2022-11-21 12:41:16 +0000

updated 2022-11-21 15:23:14 +0000

grahamb gravatar image

Hi,

I have not used Wireshark but heard a lot of good things about it.

I have the following setup on my localhost windows.

NETCONF client ---- SSH ---> ToxiProxy ----> SSH ----> Netopeer2 (NETCONF server).

This is all setup on my local windows machine. I have DockerDesktop to run ToxiProxy and Netopeer2 in containers. I use ToxiProxy to simulate peer-reset.

The first time I connect everything is fine. Then when I try to reconnect, after "reset" and connection is up, I get the following from Netopeer2 (using libssh).

2022-11-21 10:18:53,617 (Wire.java:92) DEBUG : http-outgoing-2 << "12e[\r][\n]"
2022-11-21 10:18:53,617 (Wire.java:92) DEBUG : http-outgoing-2 << "[0x2][0x0][0x0][0x0][0x0][0x0][0x0]c[2022/11/21 09:18:53.616697, 1] ssh_socket_exception_callback:  Socket exception callback: 2 (104)[\n]"
2022-11-21 10:18:53,617 (Wire.java:92) DEBUG : http-outgoing-2 << "[0x2][0x0][0x0][0x0][0x0][0x0][0x0]g[2022/11/21 09:18:53.616761, 1] ssh_socket_exception_callback:  Socket error: Connection reset by peer[\n]"
2022-11-21 10:18:53,617 (Wire.java:92) DEBUG : http-outgoing-2 << "[0x2][0x0][0x0][0x0][0x0][0x0][0x0]L[ERR]: LN: SSH key exchange error (Socket error: Connection reset by peer).[\n]"
2022-11-21 10:18:53,617 (Wire.java:92) DEBUG : http-outgoing-2 << "[\r][\n]"
2022-11-21 10:18:53,617 (Slf4jLogConsumer.java:75)  INFO : STDERR: [2022/11/21 09:18:53.616697, 1] ssh_socket_exception_callback:  Socket exception callback: 2 (104)
2022-11-21 10:18:53,617 (Slf4jLogConsumer.java:75)  INFO : STDERR: [2022/11/21 09:18:53.616761, 1] ssh_socket_exception_callback:  Socket error: Connection reset by peer
2022-11-21 10:18:53,617 (Slf4jLogConsumer.java:75)  INFO : STDERR: [ERR]: LN: SSH key exchange error (Socket error: Connection reset by peer).

I suspect there is an issue with our NETCONF client.

How can I setup wireshark (or maybe I need another tool) to trace the SSH traffic? All advice is greatly appreciated.

edit retag flag offensive close merge delete