Virtual Machine with Bridged Adapter to Centos not accepting ssh from host machine
- by javadba
I have a bridged connection on VirtualBox from os/x 10.8.5 host to Centos 5.8 client.
But I suspect this is more of a general issue than specific to the host and precise version of linux.
Shown below are the networking info from the VirtualBox and from within the guest
sshd is running on port 22:
[root@oracle-linux ~]# ps -ef | grep sshd | grep -v grep
root 3103 1 0 20:22 ? 00:00:00 /usr/sbin/sshd
root 14994 3103 0 21:23 ? 00:00:00 sshd: root@pts/1
Port 22 listening:
[root@oracle-linux ~]# netstat -an | grep 22 | grep tcp | grep LIST
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
Here are ip addresses, still on the guest os:
[root@oracle-linux ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 08:00:27:b9:e5:79 brd ff:ff:ff:ff:ff:ff
inet 10.0.15.100/24 brd 10.0.15.255 scope global eth0
inet6 fe80::a00:27ff:feb9:e579/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 08:00:27:b4:86:8a brd ff:ff:ff:ff:ff:ff
inet 10.0.3.15/24 brd 10.0.3.255 scope global eth1
inet6 fe80::a00:27ff:feb4:868a/64 scope link
valid_lft forever preferred_lft forever
[root@oracle-linux ~]#
I can ssh to the guest from the guest:
root@oracle-linux ~]# ssh 10.0.3.15
The authenticity of host '10.0.3.15 (10.0.3.15)' can't be established.
RSA key fingerprint is ef:08:19:72:95:4d:e5:28:af:f3:6f:54:07:84:ba:04.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.3.15' (RSA) to the list of known hosts.
[email protected]'s password:
Last login: Mon Oct 21 21:24:12 2013 from 10.0.15.100
But can NOT ssh from the host to the guest:
18:27:04/shared:11 $ssh [email protected]
ssh: connect to host 10.0.15.100 port 22: Operation timed out
lost connection
Here is bridged connection infO;
BTW I looked into other answers, and one of them mentioned doing
service iptables stop
That did not help.
Adapter 2 is a NAT, shown below
In case NAT is causing any issues, i shut it down and restarted networking.
[root@oracle-linux ~]# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1:
Still No joy..
18:27:04/shared:11 $ssh [email protected]
ssh: connect to host 10.0.15.100 port 22: Operation timed out
lost connection