A Blazor Web App (.NET 10) that creates and manages SSH TCP port-forwarding
tunnels using SSH.NET (Renci.SshNet) running as a background hosted service.
- Username / password SSH authentication.
- Multiple TCP port forwards (Local
-Land Remote-R) with per-entry enable/disable. - Persistent config in
%LOCALAPPDATA%\ZTunnel\config.json. - Background
IHostedServicethat keeps the SSH connection alive and auto-reconnects if it drops. - Add / edit / remove forwards live without disconnecting, or force a full reconnect at any time.
- Responsive dark UI (sidebar + top bar + cards), modal editor, live status chips.
- Built-in "Server Setup Guide" page.
| Path | What it does |
|---|---|
/ |
Dashboard — connection status, active tunnels. |
/credentials |
Configure SSH host, port, user, password. |
/tunnels |
Add / edit / remove / enable port forwards. |
/setup |
Tutorial for configuring sshd for TCP tunneling. |
cd ZTunnel
dotnet restore
dotnet runThen open https://localhost:7080 (or http://localhost:5080).
- Go to SSH Credentials, fill in host/port/user/password, click Save & Reconnect.
- Go to Port Forwards, click + Add forward, configure bound + destination host/port, save.
- Toggle forwards on/off, or click Reconnect SSH to rebuild the session.
SshTunnelService : BackgroundServiceowns a singleSshClientand a dictionary of activeForwardedPortLocal/ForwardedPortRemoteinstances.- Its main loop idles on a
CancellationTokenSourcethat is fired whenever the UI callsReconnectAsync(). AddLiveForwardAsync/RemoveLiveForwardAsyncmutate the live client without reconnecting, so you can add or remove ports on the fly.TunnelConfigStorereads/writes the JSON config on disk and holds the in-memory state shared with the UI.
- .NET 10 SDK
- An SSH server reachable from the machine running ZTunnel, with
AllowTcpForwarding yes(see/setupinside the app).