This document describes how to use trzsz-ssh (tssh + tsshd) as a modern Mosh-like alternative with support for:
- SSH-compatible syntax
- Local and remote port forwarding (
-L,-R,-D) - UDP-based roaming connections (
#!! UdpMode QUIC/KCP) - Session migration when your IP changes (ideal for LTE / mobile networks)
- High throughput compared to classic TCP SSH
- Drop-in replacement for OpenSSH client workflows
Unlike Mosh, tssh is SSH-compatible, meaning you can keep your existing SSH scripts and aliases with minimal changes.
- tssh: SSH-compatible client with optional UDP transport (QUIC or KCP)
- tsshd: Lightweight UDP server daemon used by tssh for roaming connections
Typical flow:
- tssh authenticates using OpenSSH over TCP
- tssh launches or connects to tsshd
- Session migrates to UDP for low-latency roaming
This command installs tssh, adds the trzsz repository, installs tsshd, creates a systemd service, opens UDP 40000-41000 ports, and starts the tsshd.service automatically.
Important
It is important to still have openssh server installed on the VPS, as tsshd is not a full server drop-in replacement for openssh.
bash <(curl -fSsL https://gist.githubusercontent.com/Bonveio/ee6450fd5f789f874b616d9f9ca6c9c0/raw/tsshd-install.sh)Note
Most straightforward approach is to just run tssh, and it automates adding new host for you, this is one advantage of this from other ssh clients. But own way of using tssh are just my traditional setup of how i use bash aliases(~/.bashrc) if we are using tssh on a Linux terminal.
Assuming you have already echo > ~/.ssh/config or type > %HOMEPATH%/.ssh/config(for Windows cmd.exe), you can just open ~/.ssh/config and add something like this:
Host bons1
HostName 11.22.33.44
User root
Port 22
#!! encPassword 5251ce8efd8fa02bf4ffd60a8aed39741dec5e817b82af3e9e4b2d04e23b329947abeade
#!! HideHost Yes
#!! UdpMode Yes
#!! TsshdPort 40000-41000
UserKnownHostsFile /dev/null # /nul for Windows
StrictHostKeyChecking no
LogLevel quietWhere 11.22.33.44 is your VPS ssh server address, bons1 is the shortcut way of identifying your host, and encPassword part is your VPS ssh password generated using the command tssh --enc-secret.
You can alternate #!! encPassword <hexcode_here> with #!! Password <plaintext_here> if you want it plaintext, but in practice it is better to encrypt it.
About UserKnownHostsFile & StrictHostKeyChecking, just remove those lines if you want. Just ignoring saving server ssh host keys (for dev testing stuffs) every ssh session because i dont want to manually remove entries on my known_hosts file if the vps has new ssh host keys due to openssh server reinstallations (or from the instance/vps rebuild state).
After saving your ~/.ssh/config or %HOMEPATH%/.ssh/config, simply run tssh bons1, and that's it.
How about the ~/.bashrc? just add something on your ~/.bashrc like echo 'alias bons1="tssh bons1"' >> ~/.bashrc and . ~/.bashrc,
then run bons1 and it just works like tssh bons1, some usage of bashrc may be mentioned on the other part of the document.
We have two ways, use the ~/.ssh/config or use the -L
- Via
~/.ssh/configis just like openssh way:
Host bons1
LocalForward 8080 localhost:80- Via
tssh:
tssh -L 8080:localhost:80 bons1then save the shortcut on ~/.bashrc
- QUIC mode (--udp) is stable and recommended for mobile networks
- KCP mode (--udp --kcp) is more aggressive and lower latency but may increase jitter
- Reducing MTU (e.g., 1100–1300) improves reliability on LTE and CGNAT networks
- On stable wired VPS links, OpenSSH TCP is already very fast; tssh shines on unstable links