Just found out a really neat, convenient way to transfer folders encrypted and peer-to-peer on Unix/Linux.

Destination:
$ nc -l -p 10002 | gpg -d | tar -xv

Source:
$ tar -c [folder] | gpg -c | nc [dest's hostname] 10002

I was aware of something like this before, but hadn't polished it off.

Follow

An improved, I think, version:

Destination:
$ nc -l -p 10002 | pv | gpg -d --no-symkey-cache | tar -x

Source:
$ tar -cv [folder] | gpg -c | nc [dest's hostname] 10002

The `tar` `-v` flag is moved to the source host, so that you can see `gpg -d`'s output better to check that it isn't decrypting bogus publickey-encrypted data.

This uses the `pv` command too, which is optional in the pipeline and is usually not installed. It behaves similar to `cat` but with a handy progress indicator.

@lack

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml