0

I have trouble connecting to IP 10.0.2.2 with ssh. Other IPs 10.0.3.2 and 10.0.4.2 work fine. Connecting to 10.0.2.2 with MobaXterm in Windows works and the problem is also visible when cable is not connected to any of these targets by this

ssh -vvv 10.0.2.2

almost instantly giving connection refused

OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.0.2.2 [10.0.2.2] port 22.
debug1: connect to address 10.0.2.2 port 22: Connection refused
ssh: connect to host 10.0.2.2 port 22: Connection refused

Where connection to 10.0.3.2 for example does not give connection refused instantly, as expected.

I have tried reinstalling openssh-client and openssh-server, removing .ssh/. I do not have any iptables rules. Pinging 10.0.2.2 gives a response.

I am running Debian in VirtualBox on Windows 7 64-bit.

  • 3
    Is 10.0.2.2 running an ssh server? Have you verified firewall rules on the client or on the server? – Eric Renouf Jun 29 '17 at 13:17
  • 10.0.2.2 runs busybox, I am not sure how to check ssh server is running there, but me being able to connect there with Putty on Windows side makes me confident it is running there. I have checked firewall rules on client Debian. – Kasper Kuusisto Jun 30 '17 at 9:29
0

Is your network adapter of your VM in bridge or nat ? Check if your server listening on port 22 in the /etc/ssh/sshd_config ? Also check if the issue is happening from another VM trying to connect to this one. If you could post the config file of the /etc/ssh/sshd_config it would be easier to help you troubleshoot it. Please send information as well about your Windows machine IP and subnet.

  • It seems 10.0.2.2 was reserved for NAT in VirtualBox. I managed to change it with VBoxManage modifyvm "debian64" --natnet1 "192.168/16" on Windows side. Now 10.0.2.2 is working normally. – Kasper Kuusisto Jun 30 '17 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.