You need to already know how to use a torrent client. Deluge is what I'm using because you can connect the GUI to a remote machine and configure it like it's local. The GUI I'm using is on Windows, the actually torrenting is done by Deluged on the Pi. I don't really cover the connecting bit in great detail, but there are pointers at the end. It's not difficult, and check the list of websites for the Deluge one if you need more help. Or post here.
This also assumes you're using a VPN, highly recommended in the UK at least. I'm using Mullvad (I don't get commission or anything) but any OpenVPN supplier should work, you'll just have to adapt the instructions. Torrentfreak have a good list, Mullvad aren't the *best* but they seem to be the *best value*. It means your ISP can't sniff through your traffic and anyone else you're peered with can't see your home IP address.
I delete the network's default gateway once the VPN is set up, otherwise if the VPN drops you start spewing torrent traffic from your home IP. Obviously *we'll only* be getting *Linux ISOs*, but if you want to hide your Linux-loving identity from Microsoft or anyone else, use a VPN and delete your default gateway.
There are almost certainly better ways of doing what I'm doing, but this got me up and running.
I'm assuming you know how to use (or can figure out) "nano", it's a basic text editor. If you prefer vi or emacs or whatever, feel free to use those instead.
I've incorporated the R-Pi NAS instructions into mine (as I didn't bother making a backup when I did it, and didn't bother with security.)
I figured most of this out myself before actually finding the sources, so if there's any conflict, probably best to follow the sources instead of what I've done here.
Sources:
http://elinux.org/RPi_Adding_USB_Drives
http://www.samba.org/samba/docs/man/man ... onf.5.html
http://mullvad.net/en/openvpn_conf.php
http://dev.deluge-torrent.org/wiki/UserGuide/ThinClient
Write your Raspbian image to your SD card.
Boot your Pi.
SSH into the Pi (username: pi password: raspberry ) or plug in a keyboard and display and do it locally.
Run the Raspberry Pi configuration tool.
Code: Select all
sudo raspi-config

If it asks to reboot, reboot then SSH back in.
Update and upgrade the install to the latest versions in the repository. This is the Linux equivalent of Windows Update, only better.
Code: Select all
sudo apt-get update
sudo apt-get upgrade
Change to the /dev directory so we can find out what your device has been labeled as.
Code: Select all
cd /dev
ls
Create an empty directory in /mnt to point the drive at.
Code: Select all
sudo mkdir /mnt/usbhdd
Code: Select all
sudo nano /etc/fstab
Code: Select all
/dev/sda1 /mnt/usbhdd auto defaults 0 0
http://www.tuxfiles.org/linuxhelp/fstab.html
Now we want to check it worked by telling "mount" to mount all the stuff in fstab.
Code: Select all
sudo mount -a
Now let's see if it's mounted the drive.
Code: Select all
cd /mnt/usbhdd
ls
Code: Select all
sudo apt-get install samba
Code: Select all
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old
Code: Select all
sudo apt-get install samba-common-bin
Code: Select all
sudo nano /etc/samba/smb.conf
Code: Select all
[usbhdd]
comment = Iomega Ext USB HDD
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no
locking = no
path = /mnt/usbhdd
Code: Select all
sudo /etc/init.d/samba restart
Code: Select all
sudo smbpasswd -a pi
Check you can log in to the share from your Windows machine. If it works, that's NAS sorted!
Next up, OpenVPN and the Mullvad connection.
First, see what your external (public) IP is so that we know if it changes!
Code: Select all
curl ifconfig.me
Code: Select all
sudo apt-get install openvpn resolvconf
Replace 1122334455 with your customer number.
Code: Select all
cd ~
wget http://mullvad.net/custgen.php?id=[u]1122334455[/u]
Code: Select all
mv custgen.php?id=[u]1122334455[/u] mullvadconf.zip
Code: Select all
unzip mullvadconf.zip
Replace 1122334455 with your customer number.
Code: Select all
cd [u]1122334455[/u]
It'll complain
which is fine because we don't want the OSX directory."cp: omitting directory `OSX'"
Code: Select all
sudo cp * /etc/openvpn/
Code: Select all
sudo /etc/init.d/openvpn restart
Check it worked by checking your new external IP against the one you got earlier.[ ok ] Stopping virtual private network daemon:.
[ ok ] Starting virtual private network daemon: mullvad_linux.
Code: Select all
curl ifconfig.me
Replace 192.168.1.1 with whatever your router's internal address is. Don't forget, this will stop you reestablishing your VPN if it drops!
Code: Select all
sudo route del default gw 192.168.1.1 dev eth0
Code: Select all
cd ~
Code: Select all
sudo apt-get install deluged
sudo apt-get install deluge-console
Run Deluged
Code: Select all
deluged
Code: Select all
cp ~/.config/deluge/auth cp ~/.config/deluge/auth.old
Code: Select all
nano ~/.config/deluge/auth
Code: Select all
pi:raspberry:10
Code: Select all
deluge-console
Code: Select all
config -s allow_remote True
Code: Select all
exit
Code: Select all
pkill deluged
deluged
Don't forget:
1)Change your directories to /mnt/usbhdd or whatever.
2)Disable UPnP and NAT-PMP
3)Add an incoming port to your Mullvad connection and change deluge to use it (instead of random incoming).
(If you need to put the default gateway back, for example if your VPN drops, stop all your torrent traffic then use
Code: Select all
sudo route add default gw 192.168.1.1 dev eth0