how to enable SSH into Linux VM from outside network

Discussions about using Linux guests in VirtualBox.
Post Reply
udunwanan0
Posts: 1
Joined: 24. Aug 2013, 09:20

how to enable SSH into Linux VM from outside network

Post by udunwanan0 »

I'm pretty new to Virtual Box and networking, so I apologize if the answer to my question is obvious.

I just created a new VM on Virtual Box running CentOS 5.9, the network is configured with NAT.

I use /sbin/ifconfig to get my ip address under eth0: ipaddress but whenever I try to throw that ipaddress in an ssh from an outside network it times out.

I can ssh into the guest system from my internal network if I bridge the network connection, but I read that it has to be NAT in order for ssh to work from the outside?

I've tried googling around but I couldn't find a direct answer. What other setups do I need to do?

All help is appreciated! Thank You!
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: how to enable SSH into Linux VM from outside network

Post by edstevens »

udunwanan0 wrote:I'm pretty new to Virtual Box and networking, so I apologize if the answer to my question is obvious.

I just created a new VM on Virtual Box running CentOS 5.9, the network is configured with NAT.

I use /sbin/ifconfig to get my ip address under eth0: ipaddress but whenever I try to throw that ipaddress in an ssh from an outside network it times out.

I can ssh into the guest system from my internal network if I bridge the network connection, but I read that it has to be NAT in order for ssh to work from the outside?

I've tried googling around but I couldn't find a direct answer. What other setups do I need to do?

All help is appreciated! Thank You!
What do you mean, exactly by your 'internal network' vs. "from the outside"?
In general, NAT communications must be initiated from the client machine. See http://en.wikipedia.org/wiki/Network_ad ... ranslation.
Also note that with VBox's implementation of NAT, that adapter will necessarily be DHCP.

I set up my VBox linux guests with two NICs. Adapter 1 is configured 'host only', becomes eth0, and is given a fixed IP. Adapter 2 is configured NAT, is assigned to eth1 and, as mentioned, is necessarily DHCP. The fixed IP of eth0 (hostonly) is the one I use for establishing an ssh session from the host OS.
Post Reply