title: connect via ssh to jhipster docker container on CentOS 7
body: <p>I have installed docker (<code>version 0.11.1-dev, build 02d20af/0.11.1</code>); seems to the latest available in any case for CentOS 7 (<code>yum update docker</code> says there are no updates).</p>
  <p>As per <a href="http://jhipster.github.io/installation.html" rel="nofollow noreferrer">installation instructions on jhipster site</a> I've pulled the current image and run:</p>
  <pre><code>sudo docker run -v ~/jhipster:/jhipster -p 8080:8080 -p 9000:9000 -p 4022:22 -t --name jhipster jdubois/jhipster-docker
  </code></pre>
  <p>The image is running OK. However I fail to connect via <em>ssh</em>. If I run <em>ssh</em> with verbose option:</p>
  <pre><code>ssh -vv -p 4022 jhipster@localhost
  </code></pre>
  <p>I get:</p>
  <pre><code>OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 51: Applying options for *
  debug2: ssh_connect: needpriv 0
  debug1: Connecting to localhost [::1] port 4022.
  debug1: Connection established.
  debug1: identity file /home/normunds/.ssh/id_rsa type 1
  debug1: identity file /home/normunds/.ssh/id_rsa-cert type -1
  debug1: identity file /home/normunds/.ssh/id_dsa type -1
  debug1: identity file /home/normunds/.ssh/id_dsa-cert type -1
  debug1: identity file /home/normunds/.ssh/id_ecdsa type -1
  debug1: identity file /home/normunds/.ssh/id_ecdsa-cert type -1
  debug1: Enabling compatibility mode for protocol 2.0
  debug1: Local version string SSH-2.0-OpenSSH_6.4
  debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6p1 Ubuntu-2ubuntu1
  debug1: match: OpenSSH_6.6p1 Ubuntu-2ubuntu1 pat OpenSSH*
  debug2: fd 3 setting O_NONBLOCK
  debug1: SSH2_MSG_KEXINIT sent
  Connection closed by ::1
  </code></pre>
  <p>In case I try to reach another Ubuntu host I receive the same sequence (apart from host, port and OpenSSH version), but instead of the last line with &quot;Connection closed&quot; it has:</p>
  <pre><code>debug1: SSH2_MSG_KEXINIT received
  </code></pre>
  <p>and eventually it connects successfully.</p>
  <p>I have tried to connect to via <em>localhost:4022</em>, <em>ip-of-container:22</em>; from local or remote hosts with the same results.</p>
  <p>So the problems seems to be in container or docker (or eventually ubuntu settings within docker). However <code>docker top jhipster</code> shows me <em>sshd</em> is running and - yes, the trace evidently shows that I reach the <em>ssh</em> server.</p>
  <p>Any ideas?</p>
  <p><strong>Edited</strong> I ran docker image, so that it enters command line, then ran <em>sshd</em> in debug mode:</p>
  <blockquote>
  <p>sudo docker run -v ~/projects:/jhipster -p 8080:8080 -p 9000:9000 -p 4022:22 -t -i --name jhipster jdubois/jhipster-docker /bin/bash</p>
  <p>/usr/sbin/sshd -d</p>
  </blockquote>
  <p>in order to debug further. On connection attempt <em>sshd</em> fails with:</p>
  <blockquote>
  <p>chroot(&quot;/var/run/sshd&quot;): Operation not permitted [preauth]</p>
  </blockquote>