uutransfer can transfer files using an existing screen / tmux session.
Normally, scp or sftp are used to bring files from a server to a local machine, but they may not be available in the following situations:
-
Direct SSH connection is restricted due to complex jump servers.
-
Only terminal character output is allowed due to specific network restrictions.
-
[./uutransfer-tmux] for tmux
-
[./uutransfer-tmux-v2] for tmux (send command via
tmux send-keys, defaultgzip + base64, SHA-256 verification) -
[./uutransfer-screen] for GNU screen
Requirements: ruby 2.6
# for tmux
curl https://raw.githubusercontent.com/cho45/uutransfer/master/uutransfer-screen -o /path/to/bin/uutransfer
# for screen
curl https://raw.githubusercontent.com/cho45/uutransfer/master/uutransfer-tmux -o /path/to/bin/uutransfer
chmod +x /path/to/uutransfer
uutransfer-tmux [window_index | pane_id]
$ uutransfer 1 # read active pane on window 1
$ uutransfer %13 # read pane %13
uutransfer-screen [window num]
$ uutransfer 1 # read window 1
uutransfer-tmux-v2 is a tmux-only variant that asks the remote pane to emit file contents as gzip + base64 and verifies integrity with SHA-256 after decode.
Requirements:
- local: Ruby 2.6+, tmux
- remote:
sh,openssl,gzip
uutransfer-tmux-v2 [window_index | pane_id] REMOTE_FILE [LOCAL_FILE]
$ uutransfer-tmux-v2 1 .zshrc
$ uutransfer-tmux-v2 %13 /var/log/app.log ./app.log
Behavior:
- starts transfer by sending a one-liner to the target pane using
tmux send-keys - decodes
base64, expandsgzip, writes the local file - calculates local SHA-256 and compares it with remote SHA-256
- aborts and removes the output file when hash verification fails
MIT (c) cho45@lowreal.net
