OnionShare：一个安全共享文件的开源工具
共享

> 
> OnionShare 是一个自由开源工具，它利用 Tor 网络安全和匿名地共享文件。
> 
> 
> 


![](/data/attachment/album/202008/30/103623ty2r6sz03y32o99o.jpg)


已经有很多在线服务可以安全地共享文件，但它可能不是完全匿名的。


此外，你必须依靠一个集中式服务来共享文件，如果服务决定像 [Firefox Send](https://itsfoss.com/firefox-send/) 那样关闭，那你不能真正依靠它来一直安全地共享文件。


考虑到这些，OnionShare 是一个让人惊叹的开源工具，它让你使用 [Tor Onion 服务](https://community.torproject.org/onion-services/)来共享文件。它应该是所有云端文件共享服务的一个很好的替代品。


让我们来看看它提供了什么以及它是如何工作的。


![](/data/attachment/album/202008/30/103646zsdms5282x2hbbt3.jpg)


### OnionShare: 通过 Tor 匿名分享文件


[OnionShare](https://onionshare.org/) 是一款有趣的开源工具，可用于 Linux、Windows 和 macOS。


它可以让你安全地将文件直接从你的电脑分享给接收者，而不会在这个过程中暴露你的身份。你不必注册任何帐户，它也不依赖于任何集中式存储服务。


它基本上是在 Tor 网络上的点对点服务。接收者只需要有一个 [Tor 浏览器](https://itsfoss.com/install-tar-browser-linux/)就可以下载/上传文件到你的电脑上。如果你好奇的话，我也建议你去看看我们的 [Tor 指南](https://itsfoss.com/tor-guide/)来探索更多关于它的内容。


让我们来看看它的功能。


### OnionShare 的功能


对于一个只想要安全和匿名的普通用户来说，它不需要调整。不过，如果你有需要，它也有一些高级选项。


* 跨平台支持（Windows、macOS和 Linux）。
* 发送文件
* 接收文件
* 命令行选项
* 发布洋葱站点
* 能够使用桥接（如果你的 Tor 连接不起作用）
* 能够使用持久 URL 进行共享（高级用户）。
* 隐身模式（更安全）


你可以通过 GitHub 上的[官方用户指南](https://github.com/micahflee/onionshare/wiki)来了解更多关于它们的信息。


### 在 Linux 上安装 OnionShare


你应该可以在你的软件中心找到 OnionShare 并安装它。如果没有，你可以在 Ubuntu 发行版上使用下面的命令添加 PPA：



```
sudo add-apt-repository ppa:micahflee/ppa
sudo apt update
sudo apt install -y onionshare

```

如果你想把它安装在其他 Linux 发行版上，你可以访问[官方网站](https://onionshare.org/)获取 Fedora 上的安装说明以及构建说明。


* [下载 OnionShare](https://onionshare.org/)


### OnionShare 如何工作？


当你安装好后，一切都很明了且易于使用。但是，如果你想开始，让我告诉你它是如何工作的。


完成后，它加载并连接到 Tor 网络。


#### 共享文件


![](/data/attachment/album/202008/30/103649v000cmrmcqmrc0me.png)


你只需要在电脑上添加你要分享的文件，然后点击 “**Start sharing**”。


完成后，右下角的状态应该是 “**Sharing**”，然后会生成一个 **OnionShare 地址**（自动复制到剪贴板），如下图所示。


![](/data/attachment/album/202008/30/103652rqsbo3ba4m4rfhs4.jpg)


现在接收方需要的是 OnionShare 的地址，它看上去是这样的。



```
http://onionshare:xyz@jumbo2127k6nekzqpff2p2zcxcsrygbnxbitsgnjcfa6v47wvyd.onion

```

接着 Tor 浏览器开始下载文件。


值得注意的是，下载完成后（文件传输完成），文件共享就会停止。到时候也会通知你。


所以，如果你要再次分享或与他人分享，你必须重新分享，并将新的 OnionShare 地址发送给接收者。


#### 允许接收文件


如果你想生成一个 URL，让别人直接上传文件到你的电脑上（要注意你与谁分享），你可以在启动 OnionShare 后点击 **Receive Files** 标签即可。


![](/data/attachment/album/202008/30/103653pbbgc44b5b3c5wz9.jpg)


你只需要点击 “**Start Receive Mode**” 按钮就可以开始了。接下来，你会得到一个 OnionShare 地址（就像共享文件时一样）。


接收者必须使用 Tor 浏览器访问它并开始上传文件。它应该像下面这样：


![](/data/attachment/album/202008/30/103655t5hwpog3kkhpzaw6.jpg)


虽然当有人上传文件到你的电脑上时，你会收到文件传输的通知，但完成后，你需要手动停止接收模式。


#### 下载/上传文件


考虑到你已经安装了 Tor 浏览器，你只需要在 URL 地址中输入 OnionShare 的地址，确认登录（按 OK 键），它看上去像这样。


![](/data/attachment/album/202008/30/103656vo2e5boolm59m9dt.jpg)


同样，当你得到一个上传文件的地址时，它看上去是这样的。


![](/data/attachment/album/202008/30/103658nkkd5h9gb9rnxqph.jpg)


#### 发布洋葱站点


如果你想的话，你可以直接添加文件来托管一个静态的洋葱网站。当然，正因为是点对点的连接，所以在它从你的电脑上传输每个文件时，加载速度会非常慢。


![](/data/attachment/album/202008/30/103659zp5vnp6o8p7p6pzh.jpg)


我试着用[免费模板](https://www.styleshout.com/free-templates/kards/)测试了一下，效果很好（但很慢）。所以，这可能取决于你的网络连接。


### 总结


除了上面提到的功能，如果需要的话，你还可以使用命令行进行一些高级的调整。


OnionShare 的确是一款令人印象深刻的开源工具，它可以让你轻松地匿名分享文件，而不需要任何特殊的调整。


你尝试过 OnionShare 吗？你知道有类似的软件么？请在下面的评论中告诉我！




---


via: <https://itsfoss.com/onionshare/>


作者：[Ankush Das](https://itsfoss.com/author/ankush/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
*Brief: OnionShare is a free and open-source tool that utilizes the Tor network to share files securely and anonymously.*

You might have already come across a lot of online services to share files securely but it may not be completely anonymous.

Also, you do have to rely on a centralized service to share your files and if the service decides to shut down like [Firefox Send](https://itsfoss.com/firefox-send/) — you can’t really depend on it to safely share files all the time.

All things considered, OnionShare is an amazing open-source tool that lets you share files using the [Tor Onion service](https://community.torproject.org/onion-services/). It should be an amazing alternative to all the cloud file sharing services.

Let’s take a look at what it offers and how it works.

![Onionshare](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-screenshot.jpg)

## OnionShare: Share files anonymously over Tor

[OnionShare](https://onionshare.org/) is an interesting open-source tool that’s available for Linux, Windows, and macOS.

It lets you securely share files directly from your computer to the receiver without revealing your identity in the process. You don’t have to sign up for any account — nor does it rely on any centralized storage service.

It is basically peer-to-peer over the Tor network. The receiver only needs to have a [Tor browser](https://itsfoss.com/install-tar-browser-linux/) to download/upload files to your computer. I’d also recommend you to go through our [Tor guide](https://itsfoss.com/tor-guide/) to explore more about it if you’re curious.

Let’s take a look at the features.

## Features of OnionShare

For an average user who just wants security and anonymity, there’s no tweak required. However, you do have some advanced options if you need.

- Cross-platform support (Windows, macOS, and Linux)
- Send files
- Receive files
- Command-line options
- Publish onion sites
- Ability to use bridges (if your tor connection isn’t working)
- Ability to use a persistent URL for sharing (advanced users)
- Stealth mode (more secure)

You can go through the [official user guide](https://github.com/micahflee/onionshare/wiki) on GitHub to learn more about them.

## Installing OnionShare on Linux

You should find OnionShare listed in your software center to get it installed. If it’s not there, you can add the PPA using the commands below on Ubuntu-based distros:

```
sudo add-apt-repository ppa:micahflee/ppa
sudo apt update
sudo apt install -y onionshare
```


If you’re looking to install it on other Linux distributions, you can visit the [official website](https://onionshare.org/) for installation instructions on Fedora and build instructions as well.

## How does OnionShare Work?

After you get it installed, everything is pretty self-explanatory and easy-to-use. But, if you want a heads up, let me show you how it works.

Once, it loads up and connects to the Tor network

### Sharing a File

![Onionshare Share](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-share.png)

You just have to add the file(s) that you want to share from your computer and then click on “**Start sharing**“.

Once you’re done, the status at the bottom-right should say “**Sharing**” and an **OnionShare address** will be generated (copied to clipboard automatically) as shown in the image below:

![Onionshare File Shared](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-file-shared.jpg)

All the receiver needs now is the OnionShare address that should look like this:

`http://onionshare:`[[email protected]](/cdn-cgi/l/email-protection)


And, a Tor browser to start downloading the files.

It’s worth noting that once the download completes (file transfer is done), the file sharing stops. You will also be notified of the same when that happens.

So, if you have to share it again or with someone else, you will have to re-share it and send the new OnionShare address to the receiver.

### Allow Receiving Files

If you want to generate a URL that lets someone upload files directly to your computer (be careful with whom you share it), you can just click on the **Receive Files** tab after you launch OnionShare.

![Onionshare Receive Files](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-receive-files.jpg)

You just have to click on the “**Start Receive Mode**” button to get started. Next, you will get an OnionShare address (just like while sharing a file).

The receiver has to access it using the Tor browser and start uploading files. Here’s how it should look like:

![Onionshare Receive Mode](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-receive-mode.jpg)

Even though you will be notified of the file transfer when someone is uploading to your computer, you need to manually stop the receiving mode when you’re done.

### Downloading/Uploading Files

Considering that you have a Tor browser installed, you just need to hit the OnionShare address in the URL address, confirm log in (press OK) and here’s how it should look like:

![Onionshare Download](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-download.jpg)

Similarly, when you get an address to upload files, it should look like this:

![Onionshare Upload](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-upload.jpg)

### Publish Onion Sites

You can simply add the files to host a static onion website if you want. Of course, just because it’s peer-to-peer connection, it’ll be very slow to load up while it transfers every file from your computer.

![Onionshare Onion Site](https://itsfoss.com/content/images/wordpress/2020/08/onionshare-onion-site.jpg)

I tried using a [free template](https://www.styleshout.com/free-templates/kards/) to test it out and it works great (but very slow). So, it may depend on your network connection.

**Wrapping Up**

In addition to all the features mentioned above, you can also use the command line and opt for some advanced tweaks if needed.

OnionShare is indeed an impressive open-source tool that makes it easy to share files anonymously without needing any special tweaks.

Have you tried OnionShare yet? Is there something similar to this that you know of? Let me know in the comments below!