NFS share is not a good idea on your Tor(ified) RaspberryPi

So, you created your TorRelay, you verified everything, you have your fingerprint, and you can find your stats on the TorMetrics page

https://metrics.torproject.org/rs.html.

Now you need to access to your NFS storage from your RPi. Your ip now is public... Is that a good idea? No, definitely not.

Anyway, let's play. We can remove it later.


IDENTIFY THE HOST and THE IP on your RPI

[root@jolek78-rpi3 ~]# uname -oirv 4.14.127-v7.1.el7 #1 SMP Mon Jun 17 20:40:49 UTC 2019 armv7l GNU/Linux [root@jolek78-rpi3 ~]# ifconfig eth0 |grep -w inet | awk '{print $2}' 192.168.0.8 [root@jolek78-rpi3 ~]#


IDENTIFY THE HOST and THE IP on your NAS

root@JOLE78-NAS:~# uname -oirv 3.10.105 #24922 SMP Fri May 10 02:48:35 CST 2019 armv7l GNU/Linux root@JOLE78-NAS:~# ifconfig eth0 |grep -w inet | awk '{print $2}' addr:192.168.0.7 root@JOLE78-NAS:~#


IDENTIFY DIRS you want to SHARE from your NAS

root@JOLE78-NAS:/volume1# ls -l total 192 [....] d————–+ 8 root root 4096 Jul 16 21:37 Documents d————–+ 9 root root 4096 Jul 15 23:53 Linux d————–+ 31 root root 4096 Jul 7 21:55 Music d————–+ 11 root root 4096 Jul 2 18:49 Photos d————–+ 6 root root 4096 Jul 16 21:39 Videos [....] root@JOLE78-NAS:/volume1#


CREATE DIRS on your RPI for the NFS SHARE

[jolek78@jolek78-rpi3 ~]$ mkdir Synology [jolek78@jolek78-rpi3 ~]$ cd Synology/ [jolek78@jolek78-rpi3 Synology]$ mkdir Documents Linux Music Photos Videos


MODIFY FSTAB file on your RPI

[root@jolek78-rpi3 ~]# cat /etc/fstab PARTITIONS [....] NFS SHARED DIRECTORIES – CLIENT 192.168.0.7:/volume1/Documents/ /home/jolek78/Synology/Documents/ nfs rw,user,auto 0 0 192.168.0.7:/volume1/Linux/ /home/jolek78/Synology/Linux/ nfs rw,user,auto 0 0 192.168.0.7:/volume1/Music/ /home/jolek78/Synology/Music/ nfs rw,user,auto 0 0 192.168.0.7:/volume1/Photos/ /home/jolek78/Synology/Photos/ nfs rw,user,auto 0 0 192.168.0.7:/volume1/Videos/ /home/jolek78/Synology/Videos/ nfs rw,user,auto 0 0 [root@jolek78-rpi3 ~]#


MODIFY EXPORTS file on your NAS

root@JOLE78-NAS:~# vim /etc/exports /volume1/Documents 192.168.0.8(rw,async,nowdelay,crossmnt,insecure,allsquash,insecurelocks,sec=sys,anonuid=1025,anongid=100) /volume1/Linux 192.168.0.8(rw,async,nowdelay,crossmnt,insecure,allsquash,insecurelocks,sec=sys,anonuid=1025,anongid=100) /volume1/Music 192.168.0.8(rw,async,nowdelay,crossmnt,insecure,allsquash,insecurelocks,sec=sys,anonuid=1025,anongid=100) /volume1/Photos 192.168.0.8(rw,async,nowdelay,crossmnt,insecure,allsquash,insecurelocks,sec=sys,anonuid=1025,anongid=100) /volume1/Videos 192.168.0.8(rw,async,nowdelay,crossmnt,insecure,allsquash,insecure_locks,sec=sys,anonuid=1025,anongid=100) root@JOLE78-NAS:~#


VERIFY NFS and start NFS.SERVICE on your RPI

[root@jolek78-rpi3 ~]# systemctl status nfs Unit nfs.service could not be found. <<<<<<<<<

[root@jolek78-rpi3 ~]# yum install nfs-utils [....] Resolving Dependencies —> Running transaction check —–> Package nfs-utils.armv7hl 1:1.3.0-0.61.el7 will be installed —> Finished Dependency Resolution [....] Installed: nfs-utils.armv7hl 1:1.3.0-0.61.el7
Complete!

[root@jolek78-rpi3 ~]# systemctl enable nfs Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.

[root@jolek78-rpi3 ~]# systemctl start nfs

[root@jolek78-rpi3 ~]# systemctl status nfs ● nfs-server.service – NFS server and services Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled) Active: active (exited) since Wed 2019-07-17 17:28:12 BST; 3h 46min ago Main PID: 3644 (code=exited, status=0/SUCCESS) CGroup: /system.slice/nfs-server.service [root@jolek78-rpi3 ~]#


FINALIZE the operation on your NAS

root@JOLE78-NAS:/volume1# exportfs /volume1/Documents 192.168.0.8 /volume1/Linux 192.168.0.8 /volume1/Music 192.168.0.8 /volume1/Photos 192.168.0.8 /volume1/Videos 192.168.0.8 /volume1/Pictures 192.168.0.8 root@JOLE78-NAS:/volume1# root@JOLE78-NAS:/volume1# date Wed Jul 17 22:20:41 IST 2019


FINALIZE the operation on your RPI

[root@jolek78-rpi3 jolek78]# mount -a

[root@jolek78-rpi3 jolek78]# df -HP -t nfs Filesystem Size Used Avail Use% Mounted on 192.168.0.7:/volume1/Music/ 980G 128G 853G 13% /home/jolek78/Synology/Music 192.168.0.7:/volume1/Videos/ 980G 128G 853G 13% /home/jolek78/Synology/Videos 192.168.0.7:/volume1/Photos/ 980G 128G 853G 13% /home/jolek78/Synology/Photos 192.168.0.7:/volume1/Documents/ 980G 128G 853G 13% /home/jolek78/Synology/Documents 192.168.0.7:/volume1/Linux/ 980G 128G 853G 13% /home/jolek78/Synology/Linux [root@jolek78-rpi3 jolek78]#


And now reverse the operation ;)


Music: All the Mall Artist: Emerald Park || Album: For Tomorrow

— Jolek78