Just another nearly zero configuration ngrok ssh alternative.
With automatic https, http and tcp support.
- Deploy using your favorite cloud provider.
Make sure to pass following environment variables
environment variable | required | description | example | default |
---|---|---|---|---|
DOMAIN |
yes | the domain | example.com |
|
AUTHORIZED_KEYS_BASE64 |
yes | base64 encoded .ssh/authorized_keys file | AAAA |
|
SSHD_PORT |
no | the sshd port frwd listen on | 2222 |
2222 |
frwd will automatically fetch https certificates on demand by using Let's Encrypt. The more ports available the more certificates might be created.
docker run \
--detach \
--restart unless-stopped \
--name frwd \
--network host \
--env DOMAIN=example.com \
--env AUTHORIZED_KEYS_BASE64=AAAA \
--env SSHD_PORT=2222 \
--volume /frwd_data:/data \
ghcr.io/eun/frwd:latest
-
Point your domain to the ip address of your server running the docker container.
-
Download and adjust the helper frwd.sh.
-
Run
frwd.sh <LOCAL-PORT> [REMOTE-PORT]
.
In theory you could use the publish
option of docker:
docker run ... --publish 80:80 --publish 443:443 --publish 2222:2222 ...
However this will disable the tcp functionalty.
It is not advised to publish all ports you want to use for tcp mode!
Docker starts one process for every port that is published.
Instead use the --network host
option so all ports frwd listens on get exposed directly.
Notice that this could conflict with your sshd setting.
To keep frwd from regenerating and reissuing certificates use a named volume for the docker command:
docker run ... --volume /frwd_data:/data ....
Usage without frwd.sh
- Run a local server such as
python3 -m http.server 8000
- Connect
ssh -P 2222 -R 9000:127.0.0.1:8000 frwd@example.com
- Browse to
https://9000.example.com
,http://9000.example.com
orhttp://example.com:9000