Hosting Onion Domains on Anonabox

In this 6 step tutorial, we will demonstrate the basics of how to setup hosting on an .onion domain on an anonabox. More information on onion domains and what they are used for can be found here: https://en.wikipedia.org/wiki/.onion

This tutorial assumes you have an Anonabox Pro with firmware version 4.3 or newer. Make sure before you do this that you have already set an admin password on the device for security.

Step 1) Log in to the Web based Admin interface and select “System” from the top menu bar. In the dropdown list of available options under there, select “Custom commands”

The page that comes up is the custom commands page. It looks like this:

On that page, click the button that says ‘make onion hosting directory’ The output at the bottom of the page after the command completes will be:

# mkdir “/var/lib/tor/hidden_service” Command successful (Code: 0)

Step 2) On that same page, click the button named ‘set permissions on onion’ After the command completes, the output at the bottom of that page will be:

# chmod 0600 “/var/lib/tor/hidden_service” Command successful (Code: 0)

Step 3) On that same page, click the button named ‘open port 80 for hosting’ The output at the bottom of the page after the command completes will be:

# /usr/bin/enable80.sh Command successful (Code: 0)

Step 4) Now we need to edit the tor configuration file, named torrc. To make the needed changes click on ‘Services’ at the top menu bar, and from the dropdown menu that pops up select ‘Tor’. When the Tor page comes up, look for the tab labeled ‘Advanced Configuration’ . On that page, you are able to manually edit the torrc file itself. Copy the following two lines into that file at the top:

HiddenServiceDir /var/lib/tor/hidden_service/

HiddenServicePort 80

When you are done, it will look like this:

After you do that, scroll down to the bottom of the page and click the blue button named ‘Save’. This will save the changes you just made.

Step 5) No that you have made the needed changes to your torrc file, you will need to restart Tor in order for the changes to take effect. To do this, click on “Services” at the top navigation bar, then select “Tor” from that dropdown menu. On that page that comes up, click the button labled ‘Stop Tor’. Tor should stop pretty much instantly. You will know that it is stopped when the output of that page says:

“Tor Not Running”

Now that Tor has stopped, we will need to start it again, on that same page, click the button labled ‘Start Tor’. This part of the process may take up to 60 seconds, but 30 seconds is about average. When the tor process has started, the output on that page will say:

“Connected to the Tor network”

Step 6) The next and final step is to find out what our custom onion domain is. To do this, select “System” from the top menu bar. In the dropdown list of available options under there, select “Custom commands”. This is the same page where we completed most of the previous steps. On that page, click the button labled “show onion domain” The output at the bottom of that page will be something like the following:

# cat “/var/lib/tor/hidden_service/hostname” raprzb5ktsxoxzos.onion Command successful (Code: 0)

Take note of the line with the 16 character string that ends with .onion, in this case ‘raprzb5ktsxoxzos.onion’. This is your onion domain. Anyone on the Tor network will be able to navigate to this domain and see your website. An example page is included as the default which says simply, “Hello World”.

You can test this by going to another computer that is running the Tor browser and typing it into the URL bar. You should also be able to view the onion url from computers that are connected to the anonabox.

Browsers will vary to some degree in their ability to show the domain, in chrome, you will need to add http: to the beginning of the onion domain, in our example the full URL for chrome would be http://raprzb5ktsxoxzos.onion It is always best to use incognito mode in chrome when browsing onion sites, even your own. Firefox will attempt to add a www to the beginnging of the onion url, which will prevent it from working. The Tor Browser Bundle is available for free here: https://www.torproject.org/projects/torbrowser.html.en Is probably the best way to fully test your new custom onion domain. Congratulations! 8-O You are now hosting your own custom .onion domain. One thing worth noting is that under this basic configuration, the URL of your onion domain will be reset each time the device is rebooted. So when you would like a new onion domain you can simply reboot the device. Restarting Tor will not change the onion domain, nor will clicking Stop or Start Tor from within the admin interface. Only a full reboot will generate a new randomized onion URL. Check back soon for tutorials on some of the more advanced features, including some of the following: 1) How to edit .html file with scp or ssh 2) Hosting from usb thumb drive 3) Changing onion URL to be permanent (persist after reboots) 4) Hosting Other Services besides Websites (ssh, ftp etc)