Add the 'tuser' user using adduser.sh
# adduser.sh 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 USERCOMMENT : Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully User:tuser:x:2000:2000::/data/tuser:/usr/lib/sftp-server Group:tuser:x:2000: 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-serverIf 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@10.33.5.3 Connecting to 10.3.57.3... The authenticity of host '10.33.5.3 (10.33.5.3)' 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 '10.33.5.3' (RSA) to the list of known hosts. tuser@10.33.5.3'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.jsonYou 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