Page 1 of 1

ssh_exchange_identification:Connection closed by remote host

Posted: 14. Jul 2009, 21:45
by dccothren
I have VirtualBox 3.0.0 running on Mac OSX 10.5.7. The guest is Fedora 10 and is connected to my network via NAT. I have enabled three ports from guest to host for Oracle's tnslnsr at 1521:1521, for tomcat at 8080:8080, and ssh at 2222:22. Only for ssh did I vary the guest vs. host ports since OSX is already using 22 and it is below the 1024 fence. Traffic to 1521 and 8080 are forwarded as expected. However traffic to 2222 always receives the response, "ssh_exchange_identification: Connection closed by remote host". The firewall is open. I have reset my .ssh/known_hosts. I shutdown the guest and restarted to ensure the new configuration was read. I'm out of ideas.

Re: ssh_exchange_identification:Connection closed by remote host

Posted: 16. Jul 2009, 16:47
by vbox4me2

Re: ssh_exchange_identification:Connection closed by remote host

Posted: 27. Jul 2009, 18:19
by dccothren
Both hosts.deny and hosts.allow were blank. I added "SSHD : .mydomain.com" to hosts.allow. No change.

Re: ssh_exchange_identification:Connection closed by remote host

Posted: 27. Jul 2009, 19:15
by dccothren
Additionally... I tried "sshd -t" on the guest and found that the rsa and dsa keys were missing. Corrected this by "ssh-keygen" and "ssh-keygen -t dsa". Now the "sshd -t" is clean. Still no change when trying to connect remotely.

Re: ssh_exchange_identification:Connection closed by remote host

Posted: 27. Jul 2009, 19:17
by dccothren
Attempted "ssh localhost" on guest to loop back. Got result "ssh: connect to host localhost port 22: Connection refused". Firewall is open.

Re: ssh_exchange_identification:Connection closed by remote host

Posted: 3. Sep 2009, 16:33
by dvalentiate
I had this same problem. The cause for me was that openssh-server wasn't installed on my guest ubuntu os. On the guest machine I ran

Code: Select all

sudo apt-get install openssh-server
and once complete I was able to remote into the guest os using

Code: Select all

ssh -l user -p 2222 localhost
from the host box.

See thread http://forums.virtualbox.org/viewtopic.php?t=7886 for a little more information.

Re: ssh_exchange_identification:Connection closed by remote host

Posted: 24. Jun 2010, 23:33
by michael
Just to add myself to the list, I had this trying to ssh into a Fedora 13 guest, and was able to solve it by going into the guest's firewall settings and making the network interface eth0 a "trusted interface". That may well have been a bad thing to do, but security was not an issue here and it did the trick.