Skip to content
Snippets Groups Projects
Commit 4890681b authored by David Beniamine's avatar David Beniamine
Browse files

Readme

parent 71b4d52f
No related branches found
No related tags found
No related merge requests found
This service is a reverse proxy to send requests to a ssh tunnel
Say that you have a server A that is not reachable from outside the network and a server B that is reachable.
On server B, start this service, then on server A, launch a ssh-tunnel to this service.
## Installation on the proxy server (B)
```
cp .env .env.sample
```
Then edit the following variables:
+ `SSH_PUB_KEY` : the public key of server A that will be used to log in the ssh server to create a tunnel
+ `HOSTS` a comma separated list of FQDN with backticks, i.e
```
`a.example.org`,`b.example.org`
```
+ `SSHPORT` : port to bind the conteners ssh server should be free on the host B
+ `SSHPORT_INT` : Port for making server A accessible via ssh on server B
+ `HTTPS_PORT` : Port that will be bind to HTTPS port of server A
+ `NAME` a unique name for traefik
Finally `docker-compose up -d`
## On the proxified server (A)
On the server A, put the following script in `/root/ssh-tunnel.sh` then run it after starting the services on `B`, adapt the constants to your needs
```bash
#!/bin/bash
HTTPS_PORT=8080
SSHPORT_INT=2223
SSHPORT=2222
PROXY_HOST=aquila.tetras-libre.fr
while true; do
/usr/bin/ssh -i /root/.ssh/id_rsa -N -R ${HTTPS_PORT}:localhost:443 -R ${SSHPORT_INT}:localhost:22 -o "ExitOnForwardFailure yes" -o "StrictHostKeyChecking no" -o "ServerAliveInterval 60" sshuser@${PROXY_HOST} -p ${SSHPORT}
echo "Ssh failed $?"
sleep 5
done
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment