Yuday
Yuday

Reputation: 4489

Docker, how to remote ssh from command line host to a docker container?

I've followed the steps of pipework to container assigned IP address with pipework DHCP to docker container in here

I already getting Correct IP Address accordance with local intranet segment, and I am setting Defaults Gateway to my container with pipework defaults gateway to docker container in here

And before configuration IP Address in the dockerfile already set

RUN sudo apt-get -y install openssh-server

But I am cannot remote ssh to the container,why this problem?

please help me to accomplish my tasks

Upvotes: 2

Views: 752

Answers (1)

VonC
VonC

Reputation: 1323223

Check first if docker exec would not be enough in your case: piperwork was done before docker exec was implemented:

docker exec --it <running_container> bash

That way, no need to install an openssh server.
No need for ssh. No need for port 22.

You just attach a bash session (shell session) to a running container.

Upvotes: 2

Related Questions