How to share files on Tor from Linux with Onion Share
Onion Share is a standalone application that works within Tor to securely turn any computer into a secure file server. It directly interacts with the Tor browser bundle, and uses it to set up its connections, so, you will need to go through the process of setting up Tor on Linux before installing and using this software.
Note: concerned about your privacy online while using Tor? Check out how you can use Tor with a VPN to learn about protecting yourself better.
Install Tor
To start the installation, launch a terminal and use the wget program to download the latest Tor browser bundle from the web.
wget https://www.torproject.org/dist/torbrowser/8.0.2/tor-browser-linux64-8.0.2_en-US.tar.xz
Grab this archive instead, if you require a 32-bit package:
wget https://www.torproject.org/dist/torbrowser/8.0.2/tor-browser-linux32-8.0.2_en-US.tar.xz
Extract the Tor Tar archive file in your home directory.
tar xvf tor-browser-linux64-8.0.2_en-US.tar.xz
or
tar xvf tor-browser-linux32-8.0.2_en-US.tar.xz
The Tar archive is done extracting, so the terminal is no longer needed in the Tor setup process. Open your Linux file manager, double-click on “tor-browser_en-US” and look for “Start Tor Browser.”
Double click on the icon and the Tor browser will guide you to connecting your Linux PC to the Tor network. Be sure to follow the on-screen prompts!
Install Onion Share
Onion Share has support for Linux in many ways. In this section of the tutorial, we will guide you through each of them. To use Onion Share, you’ll need Ubuntu, Debian, Arch Linux, Fedora, OpenSUSE or the ability to build and install software from source.
Ubuntu
Onion Share is installable on Ubuntu via a well-maintained PPA. This PPA has support for all modern versions of Ubuntu and is regularly updated. To add it to your PC, launch a terminal and use the apt-add-repository command.
sudo add-apt-repository ppa:micahflee/ppa
Update Ubuntu with the update command. Running this command will allow Ubuntu to set up the new Onion Share PPA.
sudo apt update
Install any pending software updates to Ubuntu, to ensure that your Linux PC is up to date.
sudo apt upgrade -y
Finally, install Onion Share on Ubuntu with:
sudo apt install onionshare python3-all python3-crypto python3-nacl python3-socks python3-stdeb dh-python python3-flask python3-stem python3-pyqt5 python-nautilus python3-pytest tor obfs4proxy
Debian
Debian Linux doesn’t get a fancy PPA or software repository as Ubuntu does, so you must build Onion Share to use it. Launch a terminal and follow the steps below to make Onion Share.
Step 1: Install the Onion Share dependencies for Debian.
sudo apt install -y git build-essential fakeroot python3-all python3-crypto python3-nacl python3-socks python3-stdeb dh-python python3-flask python3-stem python3-pyqt5 python-nautilus python3-pytest tor obfs4proxy
Step 2: Grab the latest source code of Onion share from Github with the git command.
git clone https://github.com/micahflee/onionshare.git
Step 3: Move the terminal into the source code folder with CD.
cd onionshare
Step 4: Generate an installable DEB package.
./install/build_deb.sh
Step 5: Install the Onion Share package to your PC with the dpkg tool.
sudo dpkg -i deb_dist/onionshare_*~dev-1_all.deb
Arch Linux
Arch Linux users must get OnionShare from the AUR to use it. To install it, run these commands in a terminal window.
Note: if OnionShare fails to build during this process, head over to its official AUR page and install the dependencies on the page, by hand.
sudo pacman -S base-devel git git clone https://aur.archlinux.org/onionshare.git cd onionshare makepkg -si
Fedora
Fedora has OnionShare in the main software repositories. Install it by launching a terminal window and entering the command below.
sudo dnf install onionshare
Generic Linux via source code
Those on OpenSUSE or other Linux distributions that don’t have support for OnionShare will need to build the program from source instead. To build the code, open up a terminal follow the steps below.
Step 1: Read the documentation for Onionshare and install the dependencies needed to compile the code on your operating system.
Step 2: Clone the source code with the git tool, and move the terminal into the git folder with CD.
git clone https://github.com/micahflee/onionshare.git
cd onionshare
Step 3: Run Onionshare.
For terminal mode, do:
./dev_scripts/onionshare
For GUI mode, run:
./dev_scripts/onionshare-gui
Sharing files with the OnionShare GUI
OnionShare has a GUI tool that makes it very easy to share files on Tor. To use it, ensure the Tor browser is open and connected. Then, open your application menu and search for “OnionShare” to bring up the file share GUI.
Click and drag a file or folder to upload it to OnionShare. Once added, click the “start sharing” button to make the file accessible to the Tor network. When the file upload is complete, it’ll generate a URL in the window, which can be copied by clicking the “copy URL” button.
Sharing files with the OnionShare terminal app
The OnionShare GUI is pretty neat, but those who live in the terminal may not appreciate it. Luckily, OnionShare has an excellent command-line tool that’s just as easy to use! To upload files with it connect to the Tor network with the browser bundle. Then, open up a terminal window and enter these commands.
cd /location/of/file/or/folder onionshare file
or
onionshare folder