I have docker running on a server and I deployed a container, by running:
docker run -d -p docker_server_ip:3001:22 --name test14 -ti rhel_7_4
When running docker ps
I can see the instance.
Also, I see that Docker server is listening:
netstat -ntalp | grep 3001
tcp 0 0 docker_server_ip:3001 0.0.0.0:* LISTEN 10362/docker-proxy
If I try to ssh to this container I get 'connection refused' (linux iptables is off).
ssh root@docker_server_ip -p 3001 - "ssh: connect to host docker_server_ip port 3001: Connection refused"
What am I missing?
ssh
command you are using when trying to connect.iptables
is not working properly on your server, for whatever reason (docker needds iptables).openssh-server
on the docker, setPermitRootLogin yes
in sshd_config, and createdpasswd
for root user ?