Tor(ify) your RasberryPi

If you run a Raspbian, and, you try to transform your Raspberry-Pi into a Tor Relay, should be quite easy. But, if you decide to install a Centos-Arm system, well, there are some tricky steps that needs to be done.

I sincerely hope that could be helpful for someone around the web...


IDENTIFY YOUR SD CARD

[root@alcor-laptop ~]# lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT mmcblk0 mmcblk0p1 vfat ADEA-2536 /run/media [....]


UNMOUNT YOUR SD CARD

[root@alcor-laptop ~]# umount /dev/mmcblk0


FORMAT YOUR SD CARD

[root@alcor-laptop ~]# mkfs.vfat /dev/mmcblk0 mkfs.fat 3.0.20 (12 Jun 2013)


DOWNLOAD THE LATEST RPI-CENTOS IMAGE

[root@alcor-laptop ~]# cd /home/jolek78/Downloads/ [root@alcor-laptop Downloads]# mkdir RPI4

[root@alcor-laptop Downloads]# wget http://ftp.bme.hu/centos-altarch/7.6.1810/isos/armhfp/CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1810-sda.raw.xz [....] 100%[=====>] 230,668,244 8.87MB/s in 28s
2019-07-02 19:04:33 (7.82 MB/s) – ‘CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1810-sda.raw.xz’ saved [230668244/230668244]

[root@alcor-laptop Downloads]# mv CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1810-sda.raw.xz RPI4/


CREATE THE BOOTABLE SD CARD

[root@alcor-laptop RPI4]# xzcat CentOS-Userland-7-armv7hl-RaspberryPI-GNOME-1810-sda.raw.xz

[root@alcor-laptop RPI4]# dd if=CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1810-sda.raw of=/dev/mmcblk0 status=progress bs=2M 109+1 records in 109+1 records out 230668244 bytes (231 MB) copied, 34.9449 s, 6.6 MB/s [root@alcor-laptop RPI4]#



INSERT THE SD CARD INTO THE RPI4 and LET IT INSTALL THEN CONFIGURE CENTOS and UPDATE

[root@localhost ~]# yum -y update && yum -y upgrade [...]


INSTALL PIP AND NYX – FOR MONITORING TOR CONNECTIONS

[root@localhost ~]# easy_install pip Best match: pip 19.1.1 [....] Installed /usr/lib/python2.7/site-packages/pip-19.1.1-py2.7.egg Processing dependencies for pip Finished processing dependencies for pip

[root@localhost ~]# pip install nyx [....] Installing collected packages: stem, nyx Running setup.py install for stem ... done Running setup.py install for nyx ... done Successfully installed nyx-2.1.0 stem-1.7.1


INSTALL DNF

[root@localhost tor-0.4.0.5]# yum install dnf [....]


INSTALL TOR

[root@localhost tor-0.4.0.5]# dnf install wget [....]

[root@localhost ~]# cd /home/jolek78-rpi4/Downloads/ [root@localhost Downloads]# wget https://dist.torproject.org/tor-0.4.0.5.tar.gz [....] Saving to: ‘tor-0.4.0.5.tar.gz’ 100%[=======>] 7,203,877 7.13MB/s in 1.0s

[root@localhost Downloads]# tar xzvf tor-0.4.0.5.tar.gz [....]

[root@localhost Downloads]# ls -l tor-0.4.0.5 tor-0.4.0.5.tar.gz

[root@localhost Downloads]# cd tor-0.4.0.5

[root@localhost tor-0.4.0.5]# dnf install gcc [root@localhost tor-0.4.0.5]# dnf install libevent-devel libevent [root@localhost tor-0.4.0.5]# dnf install openssl-devel openssl [root@localhost tor-0.4.0.5]# ./configure && make && make install [...]


MODIFY THE TORRC FILE

[root@localhost tor-0.4.0.5]# vim /usr/local/etc/tor/torrc

Nickname —RelayName— ORPort 9001 ControlPort 9051 SocksPort 0 ExitRelay 0 CookieAuthentication 1 ContactInfo —email@email.email—


START TOR

[jolek78-rpi4@localhost ~]$ tor [....] Jul 06 18:02:48.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit Jul 06 18:02:49.000 [notice] Bootstrapped 100% (done): Done


START NYX

[jolek78-rpi4@localhost ~]$ nyx


VERIFY YOUR CONNECTION

[root@jolek78-rpi3 ~]# easyinstall speedtest-cli Searching for speedtest-cli [....] Installing speedtest-cli script to /usr/bin Installed /usr/lib/python2.7/site-packages/speedtestcli-2.1.1-py2.7.egg Processing dependencies for speedtest-cli Finished processing dependencies for speedtest-cli

[root@jolek78-rpi3 ~]# speedtest-cli Retrieving speedtest.net configuration... Testing from Virgin Media (..........) Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Wildcard Networks (Newcastle upon Tyne) [183.24 km]: 36.175 ms Testing download speed................................................................................ Download: 51.99 Mbit/s Testing upload speed................................................................................................ Upload: 3.04 Mbit/s


Music: Scavenger Artist: Shonalika || Album:

— Jolek78