What is the easiest way to send a file:
- from an Ubuntu machine,
- to another Ubuntu user (if also to others even better) who is out of your local network,
- through an encrypted file transfer,
- using only free and open source software,
- preferably not depending on third parties like cloud apps where you have to upload the file,
- preferably not revealing your IP address and not making your machine in any way more vulnerable to the receiver of the file.
How to quickly set it up?
Your requirements #5 (no third-party/cloud storage) and #6 (no IP/hostname disclosure) are in mutual conflict: to transfer a file to a remote computer, you either make a direct connection or you don't. If you do, the remote end will have your IP address (just because of the way TCP/IP works); if you don't, then by assumption you are relaying on a third party to do the transfer and they have to store your data.
That said, there are a few approximations to your request.
F*EX: using web-based 3rd party transfer
The F*EX server was born exactly for this purpose. From the
fex
package description:As far as I understand, F*EX does not do encryption natively, but you can just encrypt the file you want to send with GPG.
The F*EX server is entirely opens-sourced, so you just install and run it on a server you trust.
The FEX homepage explains in detail how FEX compares with other file transfer services and protocols.
sendfile
: asynchronous file transfer across UNIX computersThe sendfile command has been around for about 10 years: you install it and and the accompanying daemon on both the sending and the receiving end, and then the transfer is as easy as typing:
In addition,
sendfile
can automatically encrypt the file using GPG (look for the-pe
and-ps
options).Since this makes a direct connection, however:
sendfile
port, which means it should be reachable through a public IPsendfile was written by the same authors of F*EX (see above), and they explain the reasons why they chose to switch to an HTTP-based 3rd-party service on the sendfile homepage
do-it-yourself: use
nc
It's relatively easy to do the file transfer using only netcat.
On the receiving side, you run:
After that, on the sending side, you run:
As usual, you should encrypt the file with GPG before sending (or you can do that on-the-fly with a pipe, if you are confortable with the shell). You can substitute the
9999
with any other valid port number (for instance, to make several transfers at once).Disadvantages: