torrent daemon & file server -- debian

Notes on how-to setup a torrent daemon --transmission-daemon-- and a file server on debian.

Add the 'tuser' user using
Add User:
Enter GROUPID     : 2000
Enter GROUPNAME   : tuser
Enter USERID      : 2000
Enter USERNAME    : tuser
Enter USER HOME DIRECTORY ( Or hit enter for /home/tuser ): /data/tuser
Enter USERSHELL   : /usr/lib/sftp-server
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully


tuser home Dir /data/tuser long listing:
total 24
4 drwxr-xr-x 3 tuser tuser 4096 May  7 09:39 .
4 drwxr-xr-x 5 root  root  4096 May  7 09:25 ..
4 -rw-r--r-- 1 tuser tuser  220 May  7 09:39 .bash_logout
4 -rw-r--r-- 1 tuser tuser 3184 May  7 09:39 .bashrc
4 -rw-r--r-- 1 tuser tuser  675 May  7 09:39 .profile


Get Rid off the user files, tuser is going to become an sftp user.
# rm /data/tuser/.bash*
# rm /data/tuser/.profile

Add the sftp-server shell to /etc/shells
# echo '/usr/lib/stfp-server' >> /etc/shells

Make sure that the following exists in /etc/ssh/sshd_config
#grep sftp /etc/ssh/sshd_config 
Subsystem sftp /usr/lib/openssh/sftp-server
If not, add it.

Test the sftp server and the tuser account.
# echo "blahblahtest" > /data/tuser/blah
# chown tuser.tuser /data/tuser/blah

Log in to the sftp server from another host in the network.
$ sftp tuser@
Connecting to
The authenticity of host ' (' can't be established.
RSA key fingerprint is dc:22:6c:c5:ed:44:9b:32:38:04:c2:65:8f:7f:dc:58.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
tuser@'s password: 
sftp> pwd
Remote working directory: /data/tuser
sftp> get ./blah blah-copy
Fetching /data/tuser/./blah to blah-copy
/data/tuser/./blah                                                                           100%   13     0.0KB/s   00:00   
sftp> bye

Install transmission-daemon.
# apt-get install transmission-daemon

Configure transmission-daemon
# mkdir /data/tuser/torrents
# mkdir /data/tuser/torrents/incomplete
# usermod -a -G debian-transmission tuser
# chown -R tuser.debian-transmission /data/tuser/torrents/
# chmod -R 775 /data/tuser/torrents/

# cp /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.0
# vi /etc/transmission-daemon/settings.json
You will have to change at least "rpc-password" , "incomplete-dir" , "download-dir" ,
"incomplete-dir-enabled" and "rpc-whitelist-enabled" xor "rpc-whitelist"

To reload the transmission-daemon configuration file.
# invoke-rc.d transmission-daemon reload

Test it by logging in http://host:9091.
ooups ...
it says something about no permissions when I am trying to open-upload a torrent file.

# chmod 775 /data/tuser/torrents/
# chmod 775 /data/tuser/torrents/incomplete

Test again.
OK, it works.

If the transmission daemon sits on a host in your LAN you may want to use samba ,
samba on debian based systems

Torrent daemon and file server linux debian