I'm running CentOS 7 VMs and open source Docker. I want to SSH to Docker containers from other VMs or other Docker containers. How do I do this?
I can SSH from the Docker containers to their shared host VM. I cannot SSH into the Docker containers from the host VM because of an error "Connection refused." I cannot SSH to the Docker containers from the containers themselves because of "connection refused." nmap results show that ports 1 through 1000 are closed but not filtered on each container. I tested against the IP address in the result of a docker inspect command.
I can ping the DOcker containers from each other using their IP addresses. sftp between the containers fails because of "connection refused." Given that there is no firewall rule on port 22, what is causing this "connection refused" problem?
If you are not familiar with Docker, can you provide me with possible root causes given that nmap rules out port blockage? Pings work. Docker containers function VERY similarly to Linux servers.
Connection refused when trying to SSH but port 22 is not blocked.
Re: Connection refused when trying to SSH but port 22 is not blocked.
Well no, not really, especially at the networking level.Docker containers function VERY similarly to Linux servers.
Have you exposed port 22 in the container? Given it's closed I suspect not.
A place to start: https://docs.docker.com/engine/userguid ... rnetworks/
BTW, ping != tcp connect.
Re: Connection refused when trying to SSH but port 22 is not blocked.
Can you elaborate on why "ping != tcp connect"?
Re: Connection refused when trying to SSH but port 22 is not blocked.
The ping command uses the icmp protocol. A TCP connection uses syn, ack, and then synack. Also, many things block icmp by default.
New users should check the FAQ and Read Me First pages
Re: Connection refused when trying to SSH but port 22 is not blocked.
Ditto, what he ^^^^ said
Re: Connection refused when trying to SSH but port 22 is not blocked.
telnet <hostname> 22
if you want to test to see if port 22 is blocked
if you want to test to see if port 22 is blocked