trzsz-ssh ( tssh ) is an ssh client designed as a drop-in replacement for the openssh client. It aims to provide complete compatibility with openssh, mirroring all its features, while also offering additional useful features. Such as login prompt, batch login, remember password, automated interaction, trzsz, zmodem(rz/sz), udp mode like mosh, etc.
基本思路: 1、服务端
trz / tsz
在启动时,侦听 127.0.0.1 上的一个随机端口,并将端口号告知客户端。 2、tssh
作为客户端时,会使用 SSH 隧道尝试与trz / tsz
建立连接,成功则使用隧道模式传输。 3、如果因为跳板机或docker exec
等原因,导致无法与trz / tsz
建立连接,则降级使用 trzsz 原有模式。场景举例: