Transferring Files
Sometimes we get into situations where we need to remotely transfer a file. This file could be large or it could be tiny. This file may be sensitive or could be of little importance. Regardless, sending this file over to a remote location could still have its challenges. What if the file is coming from a headless server? Perhaps you have some logs that you want to inspect on your local machine instead of parsing through them remotely in an ssh session. This is where magic-wormhole comes into play.
Installation
macOS
brew install magic-wormhole
Linux (Debian/Ubuntu)
sudo apt install magic-wormhole
Usage
To send a file, you simply use the wormhole command and specify which file you wish to send.
➜ ~ wormhole send server.log
Sending 1.1 GB file named 'server.log'
Wormhole code is: 5-hydraulic-snowslide
On the other computer, please run:
wormhole receive 5-hydraulic-snowslide
Now that we have specified which file we want to send, we've been provided with a "wormhole code" that we can use on the receiving end.
wormhole receive 5-hydraulic-snowslide
And that's all we have to do! On the receiving computer, we've downloaded the requested file! In the past, I would have used scp
or ftp
but remembering the syntax, while isn't too difficult, can prove to be challenging at times especially if nonstandard ports are used or if ports aren't opened up on the firewall to make the connection.
➜ ~ wormhole receive 5-hydraulic-snowslide
Receiving file (1.1 GB) into: server.log
ok? (y/N): y
Receiving (->tcp:some-external-ip:65250)..
80%|█████████████████▏ | 859M/1.07G [00:04<00:01, 206MB/s]