14:45 - Thursday, 17 April 2014

Virtualbox SSH From Windows 7 (host) To CentOS (guest)

#Topics: putty virtualbox connection centos,ssh from linux virtualbox to windows 7 host,virtualbox putty connection refused

My network adapter is set to “Bridged Adapter”. My CentOS (guest) IP is and I am able to view Apache web server (port 80) from Windows 7 (host) but I am unable to SSH (port 22). I get “connection refused” from putty.

Here’s a screenshot of my iptables in CentOS:

enter image description here

If you are accessing the Apache HTTP Server welcome page using localhost and not the IP address, then it is possible that dhcpcd is not running. Have you verified that sshd is running?

First make sure you can connect to the CentOS VB


  • Make sure sshd is running, the “connection refused message” usually means that sshd is not running.
/etc/init.d/sshd restart
  • Your firewall configuration appears to be ok, but just in case disable it for testing.
/etc/init.d/iptables stop
  • Also check your configuration in /etc/hosts.allow and /etc/hosts.deny, at least must have a line like:

sshd : 192.168.0. : allow