ssh内网穿透

使用ssh做内网穿透:

ssh -L local_port1:host_ip:host_port2 user_name@host_ip -p ssh_port

将本地的port1端口映射到远程主机的port2端口。

其中远程主机为内网连接,不暴露

host_ip为公网主机,将ssh_port端口转发到内网的22端口上。

现在连接本地的local_port1 就是连接远程的host_port2端口

远程的host_port2端口和docker内的端口为一致的,因此就可以远程连接docker内部。

posted @ 2020-10-18 17:26  InTheWild  阅读(260)  评论(0)    收藏  举报