Transmission Installation Tutorial via CentOS

安装

yum instal -y transmission transmission-deamon transmission-cli transmission-common

配置

/etc/init.d/transmission-daemon stop

默认配置文件路径
/var/lib/transmission/.config/transmission

{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": true,
    "blocklist-url": "/path/to/blocklist",
    "cache-size-mb": 2,
    "dht-enabled": true,
    "download-dir": "/path/to/download",
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": true,
    "incomplete-dir": "/path/to/downloading",
    "incomplete-dir-enabled": true,
    "lazy-bitfield-enabled": true,
    "lpd-enabled": false,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": 0,
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true, #远程是否需要用户名、密码认证
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true, #允许远程连接
    "rpc-password": "", #直接输入,启动transmission后会自动加密
    "rpc-port": 9999, #端口
    "rpc-username": "pzyme",#用户名
    "rpc-whitelist": "",
    "rpc-whitelist-enabled": false, #禁用白名单
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "speed-limit-down": 1000,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-slots-per-torrent": 14
}

更多配置项https://trac.transmissionbt.com/wiki/EditConfigFiles

配置完成

/etc/init.d/transmission-daemon start #启动

通过 http://host:9999 访问

问题1:访问出现403

检查rpc-whitelist和rpc-whitelist-enabled配置

问题2:访问不需要密码,rpc-authentication-required设为true重启后又变为false

首先看看 cat /etc/rc.d/init.d/transmission-deamon中DAEMON_ARGS值

#!/bin/bash
#
# This is a modified version of the original init script at
# http://jasonfriedland.blogspot.com/2009/07/init-script-for-transmission-daemon-on.html
# chkconfig: - 16 84
# description: Start up transmission-daemon
#
# processname: transmission-daemon
# config: /etc/sysconfig/transmission-daemon
 
# source function library
. /etc/rc.d/init.d/functions
 
# Get network config
. /etc/sysconfig/network
 
[ "${NETWORKING}" = "no" ] && exit 0
 
# Defaults
TRANSMISSION_HOME=/var/lib/transmission
 
DAEMON_USER="transmission"
DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"
 
# Config overrides
 
if [ -f /etc/sysconfig/transmission-daemon ]; then
        . /etc/sysconfig/transmission-daemon
fi
# Daemon
NAME=transmission-daemon
 
.......
DAEMON_ARGS="-T --blocklist -g

$TRANSMISSION_HOME/.config/transmission” -T 表示no auth,所以重启后又会变为false

PS : 更多指令 transmission-daemon -h

解决办法,直接修改-T 为 -t
或者修改vi /etc/sysconfig/transmission-daemon

TRANSMISSION_HOME=/var/lib/transmission
DAEMON_USER="transmission"
DAEMON_ARGS="-t --blocklist -g $TRANSMISSION_HOME/.config/transmission"

记得 chmod 755 /etc/sysconfig/transmission-daemon 加上执行权限

最后

/etc/init.d/transmission-daemon restart

that’s all!