A
A
artshelom2020-06-14 00:14:06
Docker
artshelom, 2020-06-14 00:14:06

How to find out the IP to connect to docker via ssh?

How to ssh into docker from host and remote machine via ssh?

I'm trying to do everything right, but I'm getting an error:

PS path>  docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ce
172.20.0.3
PS path> ssh [email protected]
ssh: connect to host 172.20.0.3 port 22: Connection timed out
PS path> ssh [email protected] -p 52743
ssh_exchange_identification: Connection closed by remote host
PS path>


SSH is installed, as is the password for it. As in this example

/etc/ssh/sshd_config - checked this file is PermitRootLogin yes, I don't understand why the docker won't let me in (

I also tried to do

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-06-14
@artshelom

You are doing something wrong... Why do you need to connect to the docker container via ssh?
What is wrong with this option?
docker exec -ti <имя контейнера> bash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question