How do I access a Docker container on my computer (Windows) on a Raspberry Pi 2 via SSH?

1

I want to connect via SSH from my computer to a specific container in my Raspberry Pi. The container already has ssh-server and allows me to connect to it from the Pi but not from the computer. I have used statements to modify NAT as:

sudo iptables -t nat -A PREROUTING -p tcp -s 192.168.0.10/32 -i eth0 -j DNAT --to-destination 192.168.100.4

but it still does not work.

Any suggestions?

    
asked by nerea conde 08.03.2017 в 16:38
source

2 answers

1

As an administrator (or using sudo):

raspi-config

Then in the menu that opens you go to the option of 'Interfancing Options' (the fifth option)

Then you go to the option of 'SSH' (P2):

And you give the option of 'Yes':

With this you can now access your Raspberry Pi via ssh, allowing you to access the docker.

    
answered by 13.07.2017 в 00:17
0

The first thing you have to know is that you do not connect to the direct container, if you can connect to the server you already have it echoed. After that you connect by ssh to the server. What you have left to do is write:

sudo docker attach dockerid

That if you already have the container running, if what you want is to connect to an image:

docker run -ti imagen

I hope I have helped you.

    
answered by 17.03.2017 в 15:42