我已经安装了 docker ( version 0.11.1-dev, build 02d20af/0.11.1
); 似乎是 CentOS 7 的最新可用(yum update docker
说没有更新)。
根据jhipster 站点上的安装说明,我提取了当前映像并运行:
sudo docker run -v ~/jhipster:/jhipster -p 8080:8080 -p 9000:9000 -p 4022:22 -t --name jhipster jdubois/jhipster-docker
图像运行正常。但是我无法通过ssh连接。如果我使用详细选项运行ssh :
ssh -vv -p 4022 jhipster@localhost
我得到:
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
如果我尝试访问另一个 Ubuntu 主机,我会收到相同的序列(除了主机、端口和 OpenSSH 版本),但不是“连接关闭”的最后一行,而是:
debug1: SSH2_MSG_KEXINIT received
并最终成功连接。
我试图通过localhost:4022,ip-of-container:22连接;从具有相同结果的本地或远程主机。
所以问题似乎出在容器或 docker 中(或最终在 docker 中的 ubuntu 设置)。但是docker top jhipster
显示sshd正在运行,并且 - 是的,跟踪显然表明我到达了ssh服务器。
有任何想法吗?
编辑后我运行了 docker image,使其进入命令行,然后在调试模式下运行sshd :
sudo docker run -v ~/projects:/jhipster -p 8080:8080 -p 9000:9000 -p 4022:22 -t -i --name jhipster jdubois/jhipster-docker /bin/bash
/usr/sbin/sshd -d
为了进一步调试。在连接尝试时sshd失败并显示:
chroot("/var/run/sshd"): 不允许操作 [preauth]