title: IBM Container , "Connection refused" when SSH to the public IP
body: <p>I'm using IBM Bluemix and Docker.</p>
  
  <p><strong>[My goal]</strong> I want to create a container. I found from the website that we could use SSH to login as "root" user. So I guess I could also install maven and MySQL on this container. Though IBM Container is a Docker based file system, we could treat container just like a Linux virtual machine (please correct me if wrong).</p>
  
  <p>I found a similar question <a href="https://developer.ibm.com/answers/questions/241975/connection-refused-error-when-accessing-to-public.html" rel="nofollow">here</a>, where njleviere said that port 22 is closed. How do I determine if a port is open or closed? If it's closed, how do I open it? Also, I think that port 22 is actually open in my case.</p>
  
  <p><strong>[Problem Description]</strong> I mainly followed <a href="http://www.slideshare.net/JosephChang8/connect-to-blumix-docker-container-with-putty" rel="nofollow">this website</a>, but I'm using Ubuntu and SSH instead of Putty.</p>
  
  <p>First, I create the key file with <code>ssh-keygen</code>. For the filename, I tried "cloud" and "cloud.key". Both failed. So I think the name for the key does not matter (please correct me if wrong). </p>
  
  <p>I open the <code>.pub</code> key. There is a <code>"yu@yu-VirtualBox"</code> tag at the end of the key file. I am not sure if I should include this tag. So I tried several things: </p>
  
  <ol>
  <li><code>ssh-rsa KeyString yu@yu-VirtualBox</code> </li>
  <li><code>ssh-rsa KeyString</code> </li>
  <li><code>KeyString</code> </li>
  </ol>
  
  <p>All failed. </p>
  
  <p>Then I created the container. I choose the <code>"ibmliberty"</code>. Given the public IP I created before (already unbind from any containers), I added 22 to the public Port. And pasted the <code>"cloud.pub"</code> to the SSH key. After several minutes, the container started to run. The following two links are the screen shot for the Bluemix console on creating the container.</p>
  
  <p>Then I could see the default page for port 9080 in browser for <a href="https://169.44.124.121:9080" rel="nofollow">https://169.44.124.121:9080</a>. It said "Welcome to Liberty" and "WebSphere Application Server V8.5.5.9".</p>
  
  <p>Then I typed (cloud and cloud.pub is the key file)</p>
  
  <blockquote>
    <p>ssh -i cloud root@169.44.124.121</p>
  </blockquote>
  
  <p>Then I get the </p>
  
  <blockquote>
    <p>ssh: connect to host 169.44.124.121 port 22: Connection refused</p>
  </blockquote>
  
  <p>I used <code>cf ic ps</code> to check the port. It looks fine.
  I see <code>169.44.124.121:22-&gt;22/tcp</code> under the PORTS.</p>
  
  <p>Also, I see many programmers use the docker file to launch the IBM Container. Should I switch to docker file instead of this IBM console web interface?</p>