Sign inSign up

ace1573/ssh-tunnel-jump

By ace1573

•Updated almost 4 years ago

通过跳板机建立内网转发

Image
0

291

ace1573/ssh-tunnel-jump repository overview

⁠Docker SSH Tunnel Jumphost

与远端主机建立隧道,可通过远端主机访问本地服务

⁠Usage

⁠Docker
  1. Put your private key (id_rsa) to ~/.ssh folder.

  2. Now in docker-compose.yml you can define the tunnel as follows:

    version: '2'
    services:
      mysql:
        image: ace1573/docker-tunnel-jump
        volumes:
          - $HOME/.ssh:/root/ssh:ro
        environment:
	  SSH_DEBUG: "-v"
          TUNNEL_HOST: tunnel-host
          REMOTE_HOST: ssh-tunnel.corporate.tld
          LOCAL_PORT: 3306
          REMOTE_PORT: 3306
          network_mode: host
          restart: always
  1. Run docker-compose up -d

After you start up docker containers, any container in the same container network will be able to access to tunneled mysql instance using tcp://tunnel-host:3306.

Tag summary

Content type

Image

Digest

sha256:1df280273…

Size

4.3 MB

Last updated

almost 4 years ago

docker pull ace1573/ssh-tunnel-jump