Hey,
In this article I will describe how to set up a Raspberry Pi, install tor and access it using tor2web.
Start by installing RASPBIAN JESSIE LITE (Minimal image based on Debian Jessie) from the raspberry pi web . I will be using this version:
Version:November 2015
Release date:2015-11-21
Kernel version:4.1
I will walk you through everything until you have a raspberry pi online with a hidden tor2web url that you can access from anywhere.
1 – Change root password
The default password is “raspberry” and user is “pi”. Make sure you change this.
2 – Updating the Pi
Once you have connected the Pi to the network make sure you update it.
apt-get update -y; apt-get upgrade -y
3 – Installing apache2
I will refer to Raspberry Pi documentation for how to install apache.
We will also configure it to only listen on localhost, as we do not need it to listen on the public interface, we will only have ssh there. This is also they way tor hidden services work, but more on that later!
This is optional. Install php, mysql and php-pdo
1 2 3 |
sudo apt-get install php5 php5-mysql sudo apt-get install mysql-server sudo mysql_secure_installation |
4 – Configure apache
We only want it to listen on localhost because we want to use it on tor. So let’s change that. Modify the file /etc/apache2/ports.conf so that it looks like this. Make sure the line is changed from “Listen 80” to “Listen 127.0.0.1:8080”.
1 |
Listen 127.0.0.1:8080 |
5 – Installing tor
1 |
sudo apt-get install tor |
6 – Configure tor
We will now create the directories and configure the hidden service. If you want to read more check the reference documentation here
Edit the file /etc/tor/torrc
1 2 |
HiddenServiceDir /etc/tor/http-server/ HiddenServicePort 80 127.0.0.1:8080 |
Time to start, “service tor start”
Your hostname will now be visible in this file:
1 |
/var/lib/tor/http-service/hostname |
Your website will now be available by accessing a url such as
https://xxxxxxxxxxxxxxx.onion.to/
Replace the x’s with your hostname found in the hostname file. This works because of the “.to” that is added to the onion domain. More information here https://tor2web.org/
To make tor start on boot, enter the following command
1 |
sudo update-rc.d tor enable |
References and additional reading