How to Securely and Anonymously Share Files of Any Size Over the Tor Network with OnionShare

It’s mid-2016 and there are lots of methods to share files online between you and another person 12 timezones away. Some of them are convenient in that they offer a certain amount of disk space for free, and also offer commercial options if you require more storage.

OnionShare - Share Files of Any Size Securely and Anonymously Over Tor Network
OnionShare – Share Files of Any Size Securely and Anonymously Over Tor Network

Of course, you can set up your alternative using a tool such as ownCloud, but what if all you need is a one-time-only method to share files privately and securely? On one hand, setting up your own cloud for this sounds like an overkill, and using a service offered by a third party leaves your data whether you want it or not available at that third party’s will, and possibly subject to government requests.

In this article we will explain how to use Onionshare, an open source desktop utility that allows you to share files hosted on your own computer of any size securely and anonymously using the Tor browser on the other end.

Please note that you don’t necessarily have to be distributing top secret or otherwise highly confidential data in order to be concerned with your privacy – being able to share files securely and anonymously should be something we have access to every day. Let’s see how we can do it very easily.

Installing Onionshare in Linux

As we mentioned earlier, with Onionshare you don’t have to store online the files you want to share. Onionshare will start a web server locally and use a Tor service to make those files available over the Internet through the Tor network.

Thus, only the person with the right permissions will be able to see them for as long as you allow them to. In theory, you will want to close the web server running on your local computer as soon as the remote user is done downloading files. Enough talk, let’s now install Onionshare. We will use the following environment:

Local host: Linux Mint 17.3 32 bits
Remote host: Windows 7 Professional 64 bits

To install Onionshare in Linux Mint, or another Ubuntu derivative (including Ubuntu itself), do:

$ sudo add-apt-repository ppa:micahflee/ppa

Press enter when you’re prompted to confirm whether you actually want the PPA to your software sources.

$ sudo apt-get update
$ sudo apt-get install onionshare

If you are using CentOS, RHEL or Fedora, make sure you have enabled the EPEL repository:

# yum update && yum install epel-release -y
# yum install onionshare

If you’re using another distribution, you may want to follow the build instructions provided by the developer in GitHub.

Once Onionshare is installed and before launching it you will also need to install and start in the background the Tor browser. This will help set up the secure channel between your computer and the remote user’s machine.

To accomplish this goal, follow these steps:

Step 1 – Head over to the Tor project’s website and download the program. At the time of this writing, the latest version of Tor is 6.0.2:

Step 2 – Untar the file, change to the directory where the files were extracted, and start Tor:

$ tar xJf tor-browser-linux32-6.0.2_en-US.tar.xz
$ cd tor-browser_en-US
$ ./start-tor-browser.desktop

Step 3 – Connect to the Tor network. You will only need to do this once.

Start Tor Browser
Start Tor Browser

We are now ready to launch Onionshare from our list of installed programs (sorry the above image is in Spanish). You can either add files using the Add Files button or dragging and dropping them in the white area (“Drag files here”):

OnionShare Secure File Sharing
OnionShare Secure File Sharing

After you started Onionshare’s web server, the files in the list become available through the given URL (see highlighted in the image above). You can then copy it using the Copy URL button and send it to the person you want to share the files with. Keep in mind, however, that this URL will not be accessible by a regular web browser such as Firefox, Google Chrome, Opera, Safari, or Internet Explorer. The other person needs to be using the Tor browser (downloads for other operating systems are available in the project’s website).

It is important to note that protecting the URL is essential in this process. You don’t want to share it over an insecure channel or non-encrypted chat service. A Google search for encrypted chat services (without quotes) will return a list of options you may want to consider to share the download URLs.

When the remote user points the Tor browser to the URL, he or she will be given the option to download the file. The blue button shows the changed name of the file, whereas the original appears right below. Tor will warn you that it can’t open the file and advise you to download it, but warning you to be aware that in order to keep your privacy- you should avoid opening files that may circumvent Tor and connect you directly to the Internet:

OnionShare File Sharing Using Tor Browser
OnionShare File Sharing Using Tor Browser

After the download is finished, the server running on your local machine will be automatically closed by Onionshare:

OnionShare File Download
OnionShare File Download

Please note that even though we have illustrated the use of Onionshare with a single file, it supports the transfer of several files and folders over a single URL, and multiple persons downloading at the same time.

Summary

In this guide we have shown how to install Onionshare and use it, along with the Tor network, to share files securely and anonymously. With Onionshare you can forget about worrying about your privacy and the care given to your personal data by third party businesses. You’re now in full control of your precious, private files.

To read more about Tor, and find out suggestions to use the network more effectively, you may want to refer to the full list of warnings in the project’s website here.

Please take a minute to let us know what you think about Onionshare using the comment form below. Questions are always welcome, so don’t hesitate to drop us a line.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Gabriel Cánepa
Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.