Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssh connection stop at "debug1: SSH2_MSG_KEXINIT sent" [closed]

Tags:

ssh

I've changed ssh port number from 22 to 2222 The previous setup connection to default ssh port 22 is fine I've Mapped the NAT on the router correctly

When i try debug it

ssh -v -p2222 www.example.com 

I get this error hanging

debug1: SSH2_MSG_KEXINIT 

Below is all debug log

bob@server:~$ ssh -v -p2222 www.example.com OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to www.example.com [100.100.100.100] port 2222. debug1: Connection established. debug1: identity file /home/bob/.ssh/identity type -1 debug1: identity file /home/bob/.ssh/id_rsa type -1 debug1: identity file /home/bob/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu1.2 debug1: match: OpenSSH_4.7p1 Debian-8ubuntu1.2 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2 debug1: SSH2_MSG_KEXINIT sent Connection closed by 100.100.100.100 

Just like that connection get closed i used gnome-terminal, putty, securecrt on couple machines in and outside the network still all get the same error

like image 697
jo3c Avatar asked Mar 10 '10 18:03

jo3c


People also ask

What is SSH2_MSG_KEXINIT?

SSH2_MSG_KEXINIT is not an error. It's just telling you that it's beginning the ssh key exchange process.

Why is SSH connection refused?

Typos or incorrect credentials are common reasons for a refused SSH connection. Make sure you are not mistyping the username or password. Then, check whether you are using the correct IP address of the server.


2 Answers

I just had this happen to me on a XEN host. I had duplicated this host from another, and as is common practice, I deleted the host keys in /etc/ssh after doing this, thinking that new ones would be generated later. But this never happened, and sshd happily started up with no host keys. When attempting to ssh to this host, it would drop out after SSH2_MSG_KEXINIT. All I had to do was create the host keys, which on debian based machine is done this way:

dpkg-reconfigure openssh-server 
like image 153
izak Avatar answered Oct 19 '22 09:10

izak


I had this problem and solved it by setting the MTU on destination router/firewall and in the destination host to the same as the source host (1500).

like image 32
ecdpalma Avatar answered Oct 19 '22 08:10

ecdpalma