tnc is a small Perl utility to simplify the use of netcat to transfer files between hosts. It automates a number of the setup commands that make this very efficient protocol so awful to set up. The commandline is meant to ape 'scp', but it can be much faster than scp, depending on the connection and types of files. Typically it's 2x - 6x faster. tnc WILL attempt to set up 2048bit RSA ssh keys for you if they don't exist on the the local host which will require entering the remote login password 2x to set up the keys. If you want to avoid this, use the '--askpass' option, which will not set up ssh-keys, but WILL use established ssh keys if they already exist. tnc does not work reliably without shared ssh keys. Unless you use the '--unpack' option, files to be transferred (even 1) are concatenated to a tar file which is sent and then left as a tar file on the other end of the connection. ie the endpoint for both push and pull data transfers will be *tar files* (compressed with 'xz' if you use the '--compress' option.) It can be used to both push and pull data from a remote connection, using only the static IP end. WARNINGS: - tnc DOES NOT ENCRYPT, nor does it compress data without being asked, so it's only meant for NON-SENSITIVE data that can be sent in the clear. Remote connections are initiated via ssh, so the actual connection setup is encrypted. Because it uses netcat's open ports it also performs SHA checksums on the data exchanged to make sure that the data stream has not been poisoned or corrupted. - There are at least 3 versions of netcat in use: nc6, nc.openbsd, and nc.traditional. tnc uses the OpenBSD version, the default on recent versions of Ubuntu, CentOS, MacOSX and others, but not on Debian. On Debian, you'll have to install it explicitly and symlink it to '/etc/alternatives/nc'. - tnc uses the piped subprocess function of bash (tee >(shasum)) to do inline SHA hash checking, so if your system lacks a recent bash, it may fail. Note that identical SHA hashes only verify that the same bytes exist on both ends. Premature failure can truncate data, so the SUMMARY now includes the # of bytes that were sent over the network as well. It supports the following options --askpass(off) .. use passwords, not ssh keys; don't try to set up ssh keys. If functional ssh keys DO exist, they will be used. --compress(off) . invokes the '-J' option to tar which uses the 'xz' compressor. Helps significantly on low bandwidth connections (wifi), but generally doesn't help on GbE networks. Depends on the compressibility of the data on 100Mb connections, but generally not. Endpoint names will be suffixed with '.xz' if this option is used, so don't pre-suffix the name. If you do, 'name.xz' will be changed to 'name.xz.xz' --port(12345) ... sets the local and remote PORTs to this #. --help .......... emits this text --unpack(off) ... unpacks the transferred files at their endpoint. You specify the dir under which it's supposed to be unpacked as the remote target. If there is a writable dir of that name, the stream will be NOT be unpacked into it unless the '--unpack' option is used. --quiet(off) .... tries to be very silent --debug(off) .... very verbose about what's going on. Simple usage: Pushing data TO a remote server: -------------------------------- (sources can be a mixture of files and dirs) tnc dir1 file1 dir2 file2 user@remotehost:/path/to/remote.tar or tnc --unpack file1 file2 file3 user@remotehost:/path/to/unpack/dir or tnc --compress geo*.dat user@remotehost:/path/to/remote.tar (which will leave the remote archive as '/path/to/remote.tar.xz') Pulling data FROM a remote server: ---------------------------------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv tnc user@remotehost:'~/dir1/ /path/to/file* ~/dir2/' \ /local/path/to/tarball Note the single quotes surrounding the remote file spec. You can use this to specify discontinuous files and dirs to pull (and you must use single quotes to specify the data to pull). The dynamic display during a transfer is from 'pv' and shows: MB time instant sent elapsed bandwidth ------------------------------ 116MB 0:00:10 [11.3MB/s] NB: tnc requires a static (or at least identifiable) IP on only one end of the connection. If you are at home, connecting thru a wireless router, and obtaining your IP address dynamically, tnc should work as well, since the work is initiated from the (static) IP #.