File sharing

File sharing

Send files between your own devices over your TxNet, end to end encrypted and without a cloud upload. How to turn it on and use it.

File sharing lets you copy files from one of your devices to another over your TxNet. The file goes straight from device to device and is encrypted the whole way. It is never uploaded to a cloud service or stored on TxHub's servers. It's handy for moving a log file off a server, or a document from your laptop to your desktop.

How it works

  • You can only send files between your own devices: devices signed in to the TxNet as the same user. You can't send a file to a colleague's device, and they can't send one to yours.
  • Files you send land in the receiving device's TxHub inbox. Nothing is written to your folders until you collect them with txhub file get.
  • Both devices must be online and connected to the TxNet when you send.
  • Sending and receiving is done with the txhub command. The TxHub app on Windows and macOS doesn't have send or receive buttons yet.

Turn file sharing on or off

File sharing is on by default for new TxNets. Admins and owners can turn it off for everyone in the TxNet:

  1. In the dashboard, go to Settings → File sharing.
  2. Turn the File sharing switch on or off.
  3. Click Save.

Devices pick up the change within seconds. When file sharing is off, txhub file cp fails because the TxNet doesn't allow sending files.

Send a file

First, list the devices you can send to. Only your own devices that are online and support file sharing are shown:

txhub file cp --targets

Then copy one or more files to a device. Put the device name (or its TxNet IP address) last, followed by a colon:

txhub file cp report.pdf desktop:
# Several files at once
txhub file cp photo1.jpg photo2.jpg laptop:
# By TxNet IP address
txhub file cp notes.txt 100.64.0.12:

A progress line is shown while the file is sent. To send the output of another command, use - as the file and give it a name:

journalctl -u nginx | txhub file cp --name=nginx.log - laptop:
Tip
Don't forget the colon at the end of the device name. Without it, txhub doesn't know which argument is the destination and stops with an error.

Receive files

On the receiving device, move everything waiting in the inbox into a folder. The folder must already exist.

PlatformCommand
Linuxsudo txhub file get ~/Downloads
macOStxhub file get ~/Downloads
Windows (PowerShell)txhub file get $HOME\Downloads

If the inbox is empty, the command returns straight away. A few options help:

  • --wait waits for a file to arrive if the inbox is empty.
  • --loop keeps running and collects files as they arrive.
  • --conflict=rename saves a file with a numbered name if a file with the same name already exists. --conflict=overwrite replaces it. The default, skip, leaves that file in the inbox and prints an error.
# Wait for the next file, then move it to the current folder
txhub file get --wait .

Linux without sudo

On Linux, txhub file get run with sudo writes the files as root. To collect files as your own user instead, allow your user to control TxHub once:

sudo txhub set --operator=$USER
txhub file get ~/Downloads

Troubleshooting

  • The device isn't in the target list. Check that it is online (txhub status) and signed in as the same user as you. Devices that belong to someone else are never listed.
  • Sending fails with "cannot send files" or "not enabled". File sharing is turned off for your TxNet. Ask an admin to turn it on under Settings → File sharing.
  • The file was sent but you can't find it. It is waiting in the inbox. Run txhub file get with a folder on the receiving device.
  • The transfer is slow. The devices may be connected through a relay server instead of directly. See Relay servers.