GNUnet
GNUnet is a framework for secure and anonymous peer-to-peer networking that does not use any centralized or otherwise trusted services. Currently, the framework offers censorship-resistant file-sharing, messaging, VPN, GNS (a decentralized version of DNS), and much more.
See also https://gnunet.org/en/use.html and Wikipedia:GNUnet.
Installation
GNUnet can be installed with the gnunetAUR package. The most recent experimental version is available as gnunet-gitAUR.
Getting started
The default GNUnet configuration is a multi-user configuration. This means that the system services are run by the gnunet
system user, while users that belong to the gnunet
group are allowed to interface with the daemon – to search and download a file for example.
Before using GNUnet you must therefore make sure to add your user to the gnunet
group to gain the necessary permissions.
Configuration
The default configuration should work out of the box in most cases. For changing the system configuration please refer to /etc/gnunet.conf
, while for changing the current user configuration please refer to ~/.config/gnunet.conf
.
See Configuration Handbook in the manual for further insight. See also #Launching the daemon as current user in a multi-user setup.
Usage
Entering the GNUnet network
Start and possibly enable the gnunet
system service. Some operations will require the gnunet
user service to be started as well.
Checking the network
You can check the current state of the network by launching the gnunet-peerinfo
command as normal user.
$ gnunet-peerinfo
To know your peer identity launch:
$ gnunet-peerinfo -s
To list the peers you are directly connected with (these are called "neighbours"), launch:
$ gnunet-core
File sharing
By default the file sharing service runs per user, which means that both the system and user gnunet
services need to be started. If you want to change this option and run the file sharing per machine, edit /etc/gnunet.conf
accordingly:
[fs] ... RUN_PER_USER = NO ... UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-fs.sock ...
Searching for a file
Use to search for a file using keywords (these are not necessarily related to the file's name). For example, to search for files that have been indexed under the “commons” keyword, launch:
$ gnunet-search --timeout='10 s' 'commons'
Without specifying a timeout (10 seconds in the example above) runs forever, waiting for the user to press CTRL-C.
The command has a option for manipulating the printed output, somewhat similar to the option of the utility. Please type for more details.
Saving search results as "GNUnet directories"
Use the -o
option of to save search results as a "GNUnet directories" (.gnd
files) – you might also want to suppress the printed output in this case (the option).
For instance, to search for three seconds and save the results yielded by the “commons” keyword into a file named , launch:
$ gnunet-search -s -t 3s -o three-seconds-commons.gnd 'commons'
If later you want to inspect the content of you can launch
$ gnunet-directory three-seconds-commons.gnd
Downloading
The output of is by default a list of commands that you can directly copy and launch as normal user.
For example, using the output generated by ,
you can launch,
which will download in the current directory.
Mounting a remote GNUnet directory without downloading it
A module, named gnunet-fuseAUR, has been developed to mount remote directories from the GNUnet network. With , directories that have been published on the GNUnet network can be mounted as read-only file systems and accessed using normal file operations. In contrast to downloading the directory recursively via , this has the advantage that files are downloaded on-demand. Only those files (or directories) that you access will be downloaded. For more information please install the module and type man gnunet-fuse
.
Uploading
Publishing a file on the GNUnet file-sharing network involves choosing keywords that can be later used by other people to search for the file.
Keywords are not strictly required, but they are recommended. This is because GNUnet does not allow searching by filename, but by keywords. The library, which is a dependency of GNUnet, can automatically extract keywords from a file, but you may wish to enter keywords of your own.
In the following example, we use the keywords "commons" and "state" to publish a file named .
GNUnet users can now find the file by using the command.
To list all the files that are currently published launch . If later you want to stop sharing a file you can use (in our example, ).
Once a file is published it is not possible to retrieve the keywords whereby the file was indexed (i.e., reverse search). It is always possible however to add further keywords to it.
Please note that it might take some time (up to some hours) till your peers can see your freshly uploaded files.
gnunet-publish
must be considered an irreversible action.The command offers an option – or equivalently --noindex
– to publish a file without indexing it. When used, GNUnet will perform a full insertion and store the entire file in encrypted form in the GNUnet database.
This option has been created with the purpose of avoiding that who takes physical access to a computer running GNUnet finds out which files are currently being published, in case of censored files in countries with strong censorship. Files published with the --noindex
option will appear as chunks downloaded from the network, and as such cannot be unpublished/unindexed (they have never been indexed in the first place); however it is always possible to specify a low content priority during publication () and tell GNUnet that the content that is going to be published is allowed to get lost easily when the database gets full.
For further information, please read the chapter on file-sharing in the handbook. See also https://gnunet.org/en/use.html#filesharing.
Modifying and removing indexed files
- When you modify a file, the URI of the file changes. Therefore, GNUnet considers this to be a completely different file and the indexed file will be considered missing. Therefore, make sure that the original file is unindexed first (using the command), modify the file, and then index the new file to make it accessible through the network.
- If you want to remove a file from your filesystem, then you should unindex it first.
- If you know in advance that a published file will likely need to be updated more or less frequently, see #Publishing updatable files
Downloading + sharing
GNUnet file-sharing network is a DHT (see Wikipedia:Distributed hash table). As peers in the DHT, users store chunks of various files on their disk, even from files they do not download or have downloaded. Which files are stored depends on the DHT distance metric / algorithm.
Technically unless a file has been completely downloaded only parts of it are stored. These are stored in a cache (typically under ). If a DHT query finds its way to a peer for one of the cached parts, the peer will provide it. The database used to store the file-sharing blocks is kept finite (below a configurable quota), and all the cached parts can expire to make space for newer files.
If someone shares a file in the GNUnet network the distributed chunks of that file will remain in the network's cache for a while, and the file will remain available even if who shared it goes offline. But if the original publisher goes missing and nobody else shared the file explicitly (with ), the file will eventually become unavailable as the peer caches expire or the peers go offline.
The only way to ensure that a file persists in the GNUnet network is then to re-publish it explicitly after downloading it (with ) and let the machine that publishes the file visit the network regularly.
Publishing a file after downloading will always generate the same URI whereby the file was downloaded ( in the example below), independently of the keywords chosen for re-publishing it:
VPN
GNUnet provides a VPN, which can be used to share your Internet connection (yes, this may be dangerous, just as running a Tor exit node), or to provide access to services on your host (this should be less dangerous, as long as those services are secure).
For information on how to set up a VPN with GNUnet, see https://gnunet.org/en/use.html#vpn.
The GNU Name Service (GNS)
The GNU Name Service (GNS) is a fully decentralized alternative to the Domain Name System (DNS) that should not suffer the same major security flaws as the latter (see Wikipedia:Domain Name System#Security issues).
For information on how to use GNS, see https://gnunet.org/en/use.html#gns_cli and https://gnunet.org/en/use.html#gns_browser.
Chatting with other GNUnet users
To chat with GNUnet users the utility is available, for which the gnunet.service
user unit needs to be started (possibly along with the gnunet.service
system unit – see #Launching the daemon as current user in a multi-user setup). For instance, to enter the “miscellanea” room using “alice” as nickname, launch
App ecosystem
GNUnet GTK
GNUnet GTK is a collection of graphical interfaces for the GNUnet framework. It ships the following GTK applications:
gnunet-namestore-gtk
To install GNUnet GTK download the package.
Messenger GTK
Currently several graphical user interfaces for chatting on the GNUnet network are being developed. One of these is Messenger GTK (, or messenger-gtk-gitAUR for the development version), a mobile-friendly GTK graphical user interface for chatting with GNUnet users. For chatting via command line, see Messenger CLI ( or for the development version).
Web User Interface
A Web interface for GNUnet exists and is available as .
re:claimID
re:claimID is a decentralized Identity Provider (IdP) service built on top of the GNU Name System. It allows users to securely share personal information with websites using standardized protocols (OpenID Connect).
For users re:claimID offers an extension for Firefox and an extension for Chromium for managing re:claimID identities in the web browser (the gnunetAUR package needs to be installed).
After having installed the extension it will be possible to add a new identity to the local re:claimID instance and add some attributes to it by visiting https://ui.reclaim/ (the link will not work without the extension installed).
For more information, please refer to the manual.
GNU Taler
GNU Taler is a microtransaction and electronic payment system built on top of GNUnet. Differently than other distributed payment systems Taler is not based on a blockchain, but on blind signatures instead.
For more information please consult the official documentation. See also packages , , taler-mdbAUR, and .
GNU Anastasis
GNU Anastasis is a protocol and implementation that allows users to securely deposit core secrets with an open set of escrow providers and to recover these secrets if their original copies are lost. Anastasis is available on AUR ( and anastasis-gtkAUR). For more information please consult https://www.gnu.org/software/anastasis/ and https://anastasis.lu/.
Troubleshooting
GNUnet fails to publish files
A common mistake for who does not understand how the GNUnet services work is that of trying to publish files located in the home directory (or in its subdirectories) when the file sharing service is not running for the current user. The problem is that the gnunet
system user (which runs the GNUnet system service) has normally no access to the home directories of other users.
An easy solution is to create a shared directory, where only users that belong to the gnunet
group have write permissions, and use it to place the files that will be published. For instance, could be a good choice:
# install -dm775 -g gnunet -o gnunet /srv/filesharing/gnunet
Each user belonging to the gnunet
group can then create a link to it in their home directory,
$ ln -s /srv/filesharing/gnunet ~/Publishing
which can be dereferenced by :
If you prefer to run the file sharing service as current user, edit /etc/gnunet.conf
accordingly:
[fs] ... RUN_PER_USER = YES ... UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-fs.sock ...
Low bandwidth
It is recommended for file-sharing that you increase GNUnet's bandwidth restrictions from the actually pretty low defaults. The example below sets the WAN and LAN limits to .
/var/lib/gnunet/ grows too big
GNUnet's cache is kept finite and cannot grow forever. However the quota reserved for it by default is not small (currently 5 GB). To reduce this number, you must assign your preferred value to the key in the section of /etc/gnunet.conf
.
/var/lib/gnunet/ is left after uninstall
The /var/lib/gnunet/
directory is the home directory of the gnunet
system user, which is left after uninstalling GNUnet. If you are sure that you are never going to use GNUnet ever again, launch:
The network is too static
By default GNUnet bootstraps itself using a file downloaded from internet (plain https
) every time it connects to the network. If you want to instruct it to learn and memorize host lists provided by other peers you need to add the option to the key under in /etc/gnunet.conf
. Further options are also available.
Tips and tricks
Launching the daemon as current user in a multi-user setup
After a fresh install the user configuration file is missing. In a multi-user setup this is almost only used (if needed) to start and stop the gnunet.service
user unit while the system daemon is running, hence it is generally enough to create a minimal configuration file containing only:
Without setting to , launching the daemon as current user while the system daemon is running will result in duplicate processes.
See The Multi-User Setup, in the manual for further insight.
A button for switching GNUnet on and off
If you use GNOME you might want to install the Systemd Manager shell extension () and add GNUnet to it:
$ dconf write /org/gnome/shell/extensions/systemd-manager/systemd \
'['\''{"name":"GNUnet system service","service":"gnunet.service","type":"system"}'\'', '\''{"name":"GNUnet user service","service":"gnunet.service","type":"user"}'\'']'
(After installing the extension you might need to restart the session.)
Single-user setup
The GNUnet peer can be started also from the current user without running the gnunet
system service. For a single-user setup make sure that and START_USER_SERVICES
are set to in ~/.config/gnunet.conf
:
To start the peer as current user, start the gnunet.service
user unit. To stop a peer which is running as current user, stop the gnunet.service
user unit.
For further information, please refer to the chapter on the single-user setup in the handbook.
Publishing updatable files
It is possible to publish "updatable" files (i.e., files for which you might want to release a different version in the future, advertising that it is the same file – just updated – and not a different one). To release an updatable file you need to create an ego and use it to sign the file. This is the only way to assure that a malicious party cannot supply counterfeited updates.
To create an ego the gnunet-identity
utility is available, for which the gnunet.service
user unit needs to be started (possibly along with the gnunet.service
system unit – see #Launching the daemon as current user in a multi-user setup). For instance, to create an ego named "caroline", start the gnunet
user unit and launch:
$ gnunet-identity -C caroline
Now that you have created an ego, you need to specify a string that identifies the current release of the file (the option), and already now the string that will identify your planned next version (the option) – you will have to remember the latter. Any content is possible for both strings.
When an update will be ready, you will have to use the same string that you had previously chosen for it ("diary version 2" in our example), possibly accompanying it with another name for a further update (if applicable):
If you decide that an update will be the last one, omit the option (will not allow any future updates).
Note that an update with GNUnet will not make the old content unavailable, GNUnet merely allows the publisher to point users to more recent versions.
Launching and stopping GNUnet without systemd
GNUnet comes with an own daemon management system, the Automatic Restart Manager (limited to the GNUnet services).
To start the system services manually without systemd launch the utility as gnunet
user:
$ sudo -u gnunet gnunet-arm -c /etc/gnunet.conf -s
To end the system services manually without systemd, launch:
$ sudo -u gnunet gnunet-arm -c /etc/gnunet.conf -e
To start the user services manually without systemd, launch the utility as current user:
$ gnunet-arm -c ~/.config/gnunet.conf -s
To end the user services manually without systemd, launch:
$ gnunet-arm -c ~/.config/gnunet.conf -e