Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to learn about Linux Containers and this is my first encounter with servers, ssh and many other things that I do not know the terms yet.

I create five different containers and authorized their keys for easy access between each other. They have internal ip (10.0.3.*). Now what I am trying is to connect these containers from other computers which are in the same network. I installed openssh-server to my machine for ssh access. But can't connect to container.

I search about it through the google but couldn't find any that works and I couldn't understand some of them.

Can someone explain (show me a way), assuming I am a beginner which I am, how to 'ssh' my containers from other machines?

If there are any additional info I need to give, I will asap. Thanks in advance.


When computers ssh each other they use eth0 or eth1. When computer(which containers are in) tries to connect to containers it uses loopback. Now lets assume we have two different computer, comp1 and comp2, which are in the same network a cisco modem that do not have internet connection. I can connect from comp1 to comp2 by;

'ssh username@comp2-ip'

But I cannot connect comp2's linux containers which are in the loopback. I want to connect them as easy as I connect comp2. Is there a way?

share|improve this question

migrated from askubuntu.com Mar 10 '14 at 13:01

This question came from our site for Ubuntu users and developers.

Can you ping the containers ? – Bahaïka Mar 10 '14 at 12:26
From local machine I can ping but from other machines I can't. It says 'Destination Net Unreachable'. – rebuked Mar 10 '14 at 13:16
Destination Net Unreachable - in that case they are probably not in the same network ( segment. – grebneke Mar 10 '14 at 13:36
Also see: unix.stackexchange.com/questions/50201/… – grebneke Mar 10 '14 at 13:37

Here are a few points to get you started:

  1. Can you ping one container from the other? Another machine on the same network?

    $ ping ip-address-of-other-container

    $ ping ip-address-of-other-machine-in-same-network

    If not, there is a networking problem

  2. Can you ssh locally?

    $ ssh ip-address-of-same-container

    If not, sshd might not be running, or there is some firewall problem

  3. Try ssh -v ip-address-of-other-container

    -v will give you debugging information which might reveal more about the issue.

share|improve this answer
1-Yes, I can ping containers from other containers. 2-I can ssh locally. 3-I can connect without any problems. There is no problem connecting containers from the computer they are installed or between each other. What i want is to connect them from another computer through the internet. – rebuked Mar 10 '14 at 13:26
Are you following a guide? Maybe update your question with info about exactly what steps you followed to setup external networking. Did you see this as an example: linux.org/threads/… – grebneke Mar 10 '14 at 13:31
I edited my question to reflect my problem better. – rebuked Mar 10 '14 at 14:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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