SSH timing out

33 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Brian Phillips

ungelesen,
06.06.2017, 11:09:4506.06.17
an passenger-docker
Trying to build an image and login but getting SSH operation timed out errors when trying to SSH in.

New to docker, so it might be something stupid that I'm doing, but here's how I'm building the image:

FROM phusion/baseimage:0.9.22

RUN rm -f /etc/service/sshd/down

# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]

# ...put your own build instructions here...

RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"

EXPOSE 22

## Install an SSH of your choice.
COPY id_rsa.pub /tmp/id_rsa.pub
RUN cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys && rm -f /tmp/id_rsa.pub

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Running the image:

docker run -t -i -p 22:2222  phusion_ssh /sbin/my_init -- bash -l

From inside the image everything looks good to me but:

FDZ452:ubuntu-docker brian.phillips$ ssh -vvv ro...@172.17.0.2 -p 22
OpenSSH_7.2p2, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug2: resolving "172.17.0.2" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 172.17.0.2 [172.17.0.2] port 22.
debug1: connect to address 172.17.0.2 port 22: Operation timed out
ssh: connect to host 172.17.0.2 port 22: Operation timed out

And when trying to use localhost I get connection refused:

FDZ452:ubuntu-docker brian.phillips$ ssh -vvv ro...@0.0.0.0 -p 2222
OpenSSH_7.2p2, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug2: resolving "0.0.0.0" port 2222
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 0.0.0.0 [0.0.0.0] port 2222.
debug1: connect to address 0.0.0.0 port 2222: Connection refused
ssh: connect to host 0.0.0.0 port 2222: Connection refused


Any ideas? I am running on a Mac if that makes any difference.


Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten