Sign inSign up

kalithekitsune/reversed-ssh-tunnel

By kalithekitsune

•Updated over 2 years ago

Pure SSH tunnel to expose a local service using a gateway

Image
0

780

kalithekitsune/reversed-ssh-tunnel repository overview

⁠Docker Reversed SSH Tunnel

Create a lightweight Alpine Linux based SSH tunnel to a host. Uses pure SSH, no fluff.

Schema for how Reversed SSH tunnels work

Image source & learn more about ssh tunneling here⁠

FORKED FROM jujhars13/docker-ssh-tunnel but reversed the tunnel direction.

⁠Perks

  • Stay up to date (with weekly builds that ensure that OpenSSH is up to date)

  • Lightweight

  • Easy to use

  • No need to install anything on the host or the client

⁠Required Parameters

VariableDescriptiondefault
SSH_PORTPort number for SSH22
SSH_USERUsername for the SSH connectionroot
CONTAINER_IPIP address of the container127.0.0.1
CONTAINER_PORTThe port you want to expose on the container80
GATEWAY_IPIP/Domain of the machine that will expose your app (the host)(required)
REMOTE_PORTWhich port should sshd listen from on the gateway80
REMOTE_IPWhich IP should sshd listen from on the gateway (* for all)*

Note: Remember to inject/mount your private SSH key into the container to /ssh_key/id_rsa.

⁠Repos

  • gcr.io: docker pull gcr.io/kalitsune/docker-reversed-ssh-tunnel
  • Docker Hub: docker pull kalithekitsune/docker-reversed-ssh-tunnel

⁠Example

please refer to the examples/docker-compose.yml⁠ file for an example.

⁠Recommandations

if you want to use an open-ssh docker container as the gatewway, you can use this linux-server.io image mod⁠

Tag summary

Content type

Image

Digest

sha256:37961d2a0…

Size

4.9 MB

Last updated

over 2 years ago

docker pull kalithekitsune/reversed-ssh-tunnel