Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. I've put together a simple service to make sure you always have a SSH tunnel open.
NOTE. This has only been tested on Kali Linux 2021.
The service file has been setup to open connections to SSH, but by editing the ngrok.service
file, you can expose any other port. You can also open multiple tunnels. Please see https://dashboard.ngrok.com/get-started/tutorials for more details.
NOTE. If you make changes to ngrok.service
after installation, be sure to run systemctl daemon-reload
to affect the changes.
The script has been setup to download the files to /opt/ngrok
and open a SSH tunnel.
sudo ./setup.sh <token_here>
- Sign up for an account at https://ngrok.com/
- Download the ngrok binary at https://dashboard.ngrok.com/get-started/setup
- Get your auth token at https://dashboard.ngrok.com/get-started/your-authtoken
- Copy
ngrok.yml
to where you would like to keep it - Copy
ngrok
binary to where you would like to keep it - Edit
ngrok.yml
to include your auth token - Copy
ngrok.service
to/lib/systemd/system/
- Edit
ngrok.service
to make sure paths are correct for the binary and the config file systemctl enable ngrok.service
systemctl start ngrok.service
systemctl status ngrok.service