I have trouble connecting to IP with ssh. Other IPs and work fine. Connecting to 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

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 [] port 22.
debug1: connect to address port 22: Connection refused
ssh: connect to host port 22: Connection refused

Where connection to 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 gives a response.

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

  • 3
    Is running an ssh server? Have you verified firewall rules on the client or on the server? Jun 29, 2017 at 13:17
  • 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. Jun 30, 2017 at 9:29

1 Answer 1


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 was reserved for NAT in VirtualBox. I managed to change it with VBoxManage modifyvm "debian64" --natnet1 "192.168/16" on Windows side. Now is working normally. Jun 30, 2017 at 10:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .