Failing to connect to an openSSH server
Hi All,
When I try to connect to an openSSH server I get the following error:
Error : Received SSH_MSG_DISCONNECT: 33554432:bad client public DH value (Full logging attached)
It seems that the server forces a disconnect.
The sshd reports:
invalid public DH value (1/1024)
Disconnecting: bad client public DH value
Question is: What causes this disconnect and how can I fix this?
When I connect using the openSSH ssh client I have no problems.
Any help with this problem is very much appreciated.
Regards,
Jeroen Pot
Senior Software Engineer
o n e 2 m a n y
Leeuwenbrug 115
7411 TH Deventer
The Netherlands
T: +31 (0)88 00 349 00
F: +31 (0)88 00 349 01
www.one2many.eu

[func] entering function ssh_connect line 628 in /usr/developers/root/libssh-0.5.0/src/client.c
[1] libssh 0.5.0 (c) 2003-2010 Aris Adamantiadis (aris@...)
Distributed under the LGPL, please refer to COPYING file for information about your rights, using
threading threads_pthread
[func] entering function ssh_socket_connect line 720 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] entering function ssh_connect_host_nonblocking line 334 in /usr/developers/root/libssh-0.5.0/src/connect.c
[3] host 10.227.180.35 matches an IP address
[func] leaving function ssh_connect_host_nonblocking line 395 in /usr/developers/root/libssh-0.5.0/src/connect.c
[2] Nonblocking connection socket: 14
[func] leaving function ssh_socket_connect line 737 in /usr/developers/root/libssh-0.5.0/src/socket.c
[2] Socket connecting, now waiting for the callbacks to work
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[3] Received POLLOUT in connecting state
[func] entering function socket_callback_connected line 57 in /usr/developers/root/libssh-0.5.0/src/client.c
[1] Socket connection callback: 1 (0)
[func] entering function ssh_client_connection_callback line 491 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function ssh_client_connection_callback line 584 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function socket_callback_connected line 72 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function callback_receive_banner line 92 in /usr/developers/root/libssh-0.5.0/src/client.c
[3] Received banner: SSH-2.0-OpenSSH_4.3
[func] entering function ssh_client_connection_callback line 491 in /usr/developers/root/libssh-0.5.0/src/client.c
[1] SSH server banner: SSH-2.0-OpenSSH_4.3
[1] Analyzing banner: SSH-2.0-OpenSSH_4.3
[1] We are talking to an OpenSSH client version: 4.3 (40300)
[func] entering function ssh_send_banner line 144 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] entering function ssh_socket_write line 584 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] entering function ssh_socket_nonblocking_flush line 606 in /usr/developers/root/libssh-0.5.0/src/socket.c
[3] Enabling POLLOUT for socket
[func] leaving function ssh_socket_nonblocking_flush line 652 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_socket_write line 592 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_send_banner line 175 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function ssh_client_connection_callback line 584 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function callback_receive_banner line 115 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_packet_socket_callback line 138 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Packet size decrypted: 700 (0x2bc)
[3] Read a 700 bytes packet
[3] 7 bytes padding, 699 bytes left in buffer
[3] After padding, 692 bytes left in buffer
[func] entering function ssh_packet_parse_type line 404 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Final size 692
[3] Type 20
[func] leaving function ssh_packet_parse_type line 424 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] entering function ssh_packet_process line 340 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Dispatching handler for packet type 20
[func] entering function ssh_packet_kexinit line 256 in /usr/developers/root/libssh-0.5.0/src/kex.c
[func] leaving function ssh_packet_kexinit line 329 in /usr/developers/root/libssh-0.5.0/src/kex.c
[func] entering function ssh_client_connection_callback line 491 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] kex algos: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
[func] server host key algo: ssh-rsa,ssh-dss
[func] encryption client->server: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@...,aes128-ctr,aes192-ctr,aes256-ctr
[func] encryption server->client: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@...,aes128-ctr,aes192-ctr,aes256-ctr
[func] mac algo client->server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@...,hmac-sha1-96,hmac-md5-96
[func] mac algo server->client: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@...,hmac-sha1-96,hmac-md5-96
[func] compression algo client->server: none,zlib@...
[func] compression algo server->client: none,zlib@...
[func] languages client->server:
[func] languages server->client:
[func] entering function set_kex line 369 in /usr/developers/root/libssh-0.5.0/src/kex.c
[func] leaving function set_kex line 397 in /usr/developers/root/libssh-0.5.0/src/kex.c
[func] entering function ssh_send_kex line 407 in /usr/developers/root/libssh-0.5.0/src/kex.c
[func] kex algos: diffie-hellman-group1-sha1
[func] server host key algo: ssh-rsa
[func] encryption client->server: aes256-ctr
[func] encryption server->client: aes256-ctr
[func] mac algo client->server: hmac-sha1
[func] mac algo server->client: hmac-sha1
[func] compression algo client->server: none
[func] compression algo server->client: none
[func] languages client->server:
[func] languages server->client:
[func] entering function packet_send2 line 454 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Writing on the wire a packet having 141 bytes before
[3] 141 bytes after comp + 6 padding bytes = 148 bytes packet
[func] entering function ssh_packet_write line 435 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] entering function ssh_socket_write line 584 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] entering function ssh_socket_nonblocking_flush line 606 in /usr/developers/root/libssh-0.5.0/src/socket.c
[3] Enabling POLLOUT for socket
[func] leaving function ssh_socket_nonblocking_flush line 652 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_socket_write line 592 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_packet_write line 440 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function packet_send2 line 515 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function ssh_send_kex line 449 in /usr/developers/root/libssh-0.5.0/src/kex.c
[func] entering function dh_handshake line 326 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] entering function packet_send2 line 454 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Writing on the wire a packet having 6 bytes before
[3] 6 bytes after comp + 5 padding bytes = 12 bytes packet
[func] entering function ssh_packet_write line 435 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] entering function ssh_socket_write line 584 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] entering function ssh_socket_nonblocking_flush line 606 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_socket_nonblocking_flush line 623 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_socket_write line 592 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_packet_write line 440 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function packet_send2 line 515 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function dh_handshake line 375 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function ssh_client_connection_callback line 584 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] leaving function ssh_packet_process line 367 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function ssh_packet_socket_callback line 280 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_socket_nonblocking_flush line 606 in /usr/developers/root/libssh-0.5.0/src/socket.c
[3] Enabling POLLOUT for socket
[func] leaving function ssh_socket_nonblocking_flush line 652 in /usr/developers/root/libssh-0.5.0/src/socket.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_handle_packets line 430 in /usr/developers/root/libssh-0.5.0/src/session.c
[func] entering function ssh_packet_socket_callback line 138 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Packet size decrypted: 44 (0x2c)
[3] Read a 44 bytes packet
[3] 4 bytes padding, 43 bytes left in buffer
[3] After padding, 39 bytes left in buffer
[func] entering function ssh_packet_parse_type line 404 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Final size 39
[3] Type 1
[func] leaving function ssh_packet_parse_type line 424 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] entering function ssh_packet_process line 340 in /usr/developers/root/libssh-0.5.0/src/packet.c
[3] Dispatching handler for packet type 1
[3] Received SSH_MSG_DISCONNECT 33554432:bad client public DH value
[1] Error : Received SSH_MSG_DISCONNECT: 33554432:bad client public DH value
[func] leaving function ssh_packet_process line 367 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function ssh_packet_socket_callback line 280 in /usr/developers/root/libssh-0.5.0/src/packet.c
[func] leaving function ssh_handle_packets line 445 in /usr/developers/root/libssh-0.5.0/src/session.c
[3] ssh_connect: Actual state : 9
[func] leaving function ssh_connect line 705 in /usr/developers/root/libssh-0.5.0/src/client.c
[func] entering function ssh_free line 160 in /usr/developers/root/libssh-0.5.0/src/session.c