Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/silaskalmbach/docker_autossh_tunnel

Minimal Dockerfile to pass any number of ports with autossh through an ssh tunnel
https://github.com/silaskalmbach/docker_autossh_tunnel

autossh autossh-tunnel-server balena docker docker-compose homelab raspberry-pi

Last synced: 22 days ago
JSON representation

Minimal Dockerfile to pass any number of ports with autossh through an ssh tunnel

Awesome Lists containing this project

README

        

# Flexible Autossh Tunnel (Docker)

Minimal Dockerfile to pass any number of ports with autossh through an ssh tunnel. The Dockerfile is designed to allow ssh-keygen to be included without linking them in a separate volume. Well suited to include them in IoT services like Balena.

To do this, add your ssh key to the folder "ssh_key" and specify it's name in docker-compose.
If you don't want to use an ssh key, just remove the part "-i /ssh_key/${KEYNAME}"\ from the tunnel.sh file.

### Docker-Compose example, as it can also be found in the repository:

```yaml
version: '2.1'

services:
tunnel:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
- 3001:3001 #Ports not necessary for an reverse ssh tunnel
environment:
- TUNNEL=-R 0.0.0.0:3000:localhost:80 -L 3001:localhost:1880 #as many tunnels as you like
- SSH_USER=ubuntu
- KEYNAME=example.key
- SSH_PORT=22 #22 [Default]
```

---
© Silas Kalmbach