Win10 ssh login to the docker container in the virtual machine (Centos7)

2020.12.17 Pro-test is feasible

 

1. Windows, Linux virtual machine, docker relationship diagram

 

If the ping of the Docker container on the Windows host is different at this time, because there is no route to the 172.17.0.0/24 network on the host, the host will send the data sent to the 172.17.0.0/24 network to the default route. , So that the container cannot be reached.

 

2. Operation

2.1 Turn off the firewall in Linux

[root@bigdata ~]# systemctl stop firewalld.service  (这一步很重要,原因看最后的 2.7 节)

2.2 Install and enable ssh service in docker container

[root@spark6 redis]# /usr/sbin/sshd

2.3 Network Interworking between Windows Host and Virtual Machine CentOS

Log in via MobaXtem

2.4 Network communication between the virtual machine CentOS and Docker container

In CentOS, you can enter the container through the docker exec -it <container_id> /bin/bash command

2.5 at W

Guess you like

Origin blog.csdn.net/JineD/article/details/111315149