Examples
--------
Many examples can be found in /usr/share/doc/netcat-traditional/README.gz. The rest of
this file collects some more that have been contributed by users.
Encrypted File Transfer
(courtesy of Tom Buskey <tom@buskey.name>)
Suppose you have an ssh tunnel, and you want to copy a file to the
remote machine. You could just scp it directly, but that opens up
another connection. The goal is to re-use the existing connection.
You can use netcat to do this:
When you SSH in, add -L 31000:127.0.0.1:31000
On the remote:
nc -lvnp 31000 127.0.0.1 > file
On the local:
nc -v -w 2 127.0.0.1 31000 < file
No extra overhead. TCP takes care of error correction. SSH has
already encrypted the pipe.
|