Skip to content

Instantly share code, notes, and snippets.

@EmbeddedAndroid
Last active March 27, 2020 18:23
Show Gist options
  • Save EmbeddedAndroid/18491b1e2e44707e542b2191fb69802a to your computer and use it in GitHub Desktop.
Save EmbeddedAndroid/18491b1e2e44707e542b2191fb69802a to your computer and use it in GitHub Desktop.
SSH Reverse Tunnel Docker App
version: 0.1.0
name: sshtun
description: Reverse SSH Tunnelling Docker App
---
version: '3.2'
services:
sshtun:
image: hub.foundries.io/<factory>/sshtun:latest
restart: always
tty: true
network_mode: "host"
command: "-R0:localhost:${local_port} -i /root/.ssh/pkey.pem -p ${server_port} ${user}@${server_hostname}"
environment:
- SERVER_HOSTNAME=${server_hostname}
- SERVER_ALGO=${server_algo}
- SERVER_HOST_KEY=${server_host_key}
volumes:
- /var/sota/pkey.pem:/root/.ssh/pkey.pem
---
local_port: 22
user: root
server_hostname: <hosted server ip or hostname>
server_host_key: AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEhRBc21OTC5oVUEHUdVYSQH0P8fpJLWd+xFZKdhza5odGj7FFN0e46MTLirOncg4PO4j9tpx+s2nW4wtMsZt90=
server_algo: ecdsa-sha2-nistp256
server_port: 2222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment