SSH Tunnel with Autossh and Docker: Difference between revisions
Jump to navigation
Jump to search
Created page with "= SSH Tunnel with Autossh and Docker =" |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= SSH Tunnel with Autossh and Docker = | = SSH Tunnel Gateway with Autossh and Docker = | ||
== What is this tool for? == | |||
* Allow you to tunnel remote targets through multiple ssh servers | |||
* Clients can connect to your ssh tunnel gateway on your local network | |||
* Easy configuration (YAML) | |||
* Easy and secure installation (Docker) | |||
[[File:Sshtunnel3.png|thumb|Big overview]] | |||
== YAML sample == | |||
main: | |||
listen: 0.0.0.0 | |||
tunnels: | |||
- remote: username@remote_ip | |||
ports: | |||
# ssh | |||
- local: 2000 # This has to match docker-compose file | |||
remote_target: localhost | |||
remote_port: 22 | |||
== Installation == | |||
[[File:Sshtunnel4.png|thumb|Basic diagram]] | |||
# Download on [https://github.com/koss822/misc/tree/master/Linux/Projects/sshtunnel-daemon GitHub] | |||
# Install Ubuntu (or other Linux) | |||
# Install docker | |||
# sudo apt install docker.io | |||
# Add your user to docker group (do not forget to relogin) - sudo usermod -a -G docker your_username | |||
# Install docker compose | |||
# sudo apt install curl | |||
# sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |||
# sudo chmod +x /usr/local/bin/docker-compose | |||
# Generate ssh-keys | |||
# cd settings | |||
# ssh-keygen -f ./id_rsa | |||
# Edit settings/sshtunnel.yml | |||
# Edit docker-compose.yml | |||
# Run docker-compose build | |||
# Try docker-compose up (after CTRL-C) | |||
# Run docker-compose up -d (it should start after restart) |
Latest revision as of 11:22, 31 May 2020
SSH Tunnel Gateway with Autossh and Docker
What is this tool for?
- Allow you to tunnel remote targets through multiple ssh servers
- Clients can connect to your ssh tunnel gateway on your local network
- Easy configuration (YAML)
- Easy and secure installation (Docker)
YAML sample
main: listen: 0.0.0.0 tunnels: - remote: username@remote_ip ports: # ssh - local: 2000 # This has to match docker-compose file remote_target: localhost remote_port: 22
Installation
- Download on GitHub
- Install Ubuntu (or other Linux)
- Install docker
- sudo apt install docker.io
- Add your user to docker group (do not forget to relogin) - sudo usermod -a -G docker your_username
- Install docker compose
- sudo apt install curl
- sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- Generate ssh-keys
- cd settings
- ssh-keygen -f ./id_rsa
- Edit settings/sshtunnel.yml
- Edit docker-compose.yml
- Run docker-compose build
- Try docker-compose up (after CTRL-C)
- Run docker-compose up -d (it should start after restart)