Archive

Posts Tagged ‘Torrent’

Raspberry Pi Torrent Box – Transmission-Daemon and Samba

May 2nd, 2013 2 comments

Very long time with no updates mates! Sorry ’bout that but life is something happening to you when you made other plans.

We do not encourage nor worship piracy, we are just showing how to legally use the Raspberry Pi as a Torrent Box to download legit torrent files

At the moment the situation is as follows:

Hardware: Raspberry Pi + Samsung SD Card 8Gb + SanDisk Cruzer USB Flash 16Gb + LAN Cable + Samsung Galaxy Advance S Power Adapter
OS: Raspbian Wheezy

I assume your Raspberry is up and running and you know its IP Address and are able to SSH to it, likely via PuTTY

Login with user “pi” and pwd “raspberry”

Change user “pi” default pwd by typing “passwd”, type old pwd then new pwd twice “password” without quotes

On your Winows Workstation, create PuTTY shortcut and change it to
x:\Prog\PuTTY\putty.exe pi@192.168.1.2 -pw “password” without quotes

Get to know the disk table by typing “sudo fdisk -l” U’ll see something like:

Device Boot Start End Blocks Id System
/dev/sda1 32 31266815 15633392 7 HPFS/NTFS/exFAT

Run Raspi-Config by typing “sudo raspi-config”, then choose “expand_rootfs” to use the whole SD room, then “overscan”, then “ssh enable” and “boot gui disable”. Then “update” and choose “yes”

Update and Upgrade (It will take a white)

“sudo apt-get update”
“sudo apt-get upgrade”

Install ntfs-3g to format and use NTFS drives
“sudo apt-get install ntfs-3g”

Format USB Drive as NTFS without zeroing the drive
“sudo mkntfs -f /dev/sda1”

Create a folder to mount the first usb drive
“sudo mkdir /media/usb1”

Mount usbdrive on /media/usb1
“sudo mount -t auto /dev/sda1 /media/usb1/”

Create folder “shares”
“sudo mkdir /media/usb1/shares”

Install Samba and Samba-common-bin
“sudo apt-get -y install samba samba-common-bin”

Backup Samab Configuration File smb.conf
“sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.original”

Edit smb.conf, line 102
sudo pico /etc/samba/smb.conf
# security = user

Add this section at the bottom:

[USB1]
comment = USB1 Share
path = /media/usb1
writeable = Yes
only guest = Yes
create mask = 0777
directory mask = 0777
browseable = Yes
public = yes

Edit file system table
“sudo nano /etc/fstab”

Automount USB Drive by adding this at the bottom
# automount usb1 on /media/usb1
/dev/sda1 /media/usb1 auto noatime 0 0

Check what is working by typing “sudo reboot”
Login again and check check autorun ssh, automount samba autostart
Type “df -kh” to see the disk free

Restart Samba
“sudo /etc/init.d/samba restart”

Install transmission
“sudo apt-get -y install transmission transmission-daemon”

“Run transmission-daemon and then quit it
“sudo service transmission-daemon start”
“sudo service transmission-daemon stop”

Backup Transmission Settings
“sudo cp /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.original”

Create some folders
“sudo mkdir /media/usb1/shares/transmission”
“sudo mkdir /media/usb1/shares/transmission/download”
“sudo mkdir /media/usb1/shares/transmission/complete”

Edit Settings.json
“sudo pico /etc/transmission-daemon/settings.json”

Set “download-dir”: “/var/transmission-daemon/downloads”,
as “download-dir”: “/media/usb1/shares/transmission/complete”,

Set “incomplete-dir”: “/root/Downloads”,
as “incomplete-dir”: “/media/usb1/shares/transmission/download”,

Set “incomplete-dir-enabled”: false,
as “incomplete-dir-enabled”: true,

Set “rpc-username”: “transmission”,
as “rpc-username”: “pi”,

Set “rpc-password”: “{9474cc0e2e72c4390b780a4fd66ca0e7aa057c4b8zT1w8Xh”,
as “rpc-password”: “password”,
(Transmission will hash the password so don’t worry, it won’t be plan text)

Set “rpc-whitelist-enabled”: true,
as “rpc-whitelist-enabled”: false,

Restart Transmission
“sudo service transmission-daemon start”

Backup Settings.json
“sudo cp /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.good”

Restart Samba
“sudo service samba restart”

Check shares
“sudo testparm -s”

From Explorer under Windows open \\raspberrypi and you should see a folder called “usb1” accessible without credentials

Forward port 9091 and 51413 to your Raspberry Pi’s IP Address

In your browser open http://raspberry-ip-address:9091
and login with user “pi” and pwd “password”

Click on “open torrent” Folder Icon and add a torrent file

Enjoy