一、PVE创建CT容器
-
在宿主机上创建容器需要挂载的目录
mkdir -p /root/Transmission/ chown -R 100103:100112 /root/Transmission/
-
创建CT容器
pct create 1001 \ local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst \ --ostype=debian \ --hostname=Transmission \ --arch=amd64 \ --cores=1 \ --features=nesting=1 \ --memory=512 \ --swap=512 \ --unprivileged=1 \ --net0=bridge=vmbr0,name=eth0,ip=dhcp \ --rootfs=local-thin:8 \ --mp1=/root/Transmission,mp=/Download \ --description="Transmission"
-
启动CT容器
pct start 1001
-
进入CT容器
pct enter 1001
-
测试网络
ping www.baidu.com
-
编辑
/etc/bash.bashrc
enable bash completion in interactive shells
这一项配置,将其注释全部去掉。vi /etc/bash.bashrc
取消第35行至第41行注释
sed -e '35,41 s/^#//' -i /etc/bash.bashrc
编辑/etc/profile
,在最后面添加一行source /etc/bash.bashrc
sed -e '$a\\nsource /etc/bash.bashrc' -i /etc/profile
-
修改环境变量
编辑~/.bashrc
文件,在文件最后添加下列内容vi ~/.bashrc
sed -e '$a \\n' \ -e '$a HISTSIZE=50000' \ -e '$a HISTFILESIZE=50000' \ -e '$a HISTCONTROL=ignoreboth' \ -e '$a export LS_OPTIONS='\''--color=auto'\''' \ -e '$a eval "$(dircolors)"' \ -e '$a alias ls='\''ls $LS_OPTIONS'\''' \ -e '$a alias ll='\''ls $LS_OPTIONS -l --time-style="+%Y-%m-%d %H:%M:%S"'\''' \ -e '$a alias l='\''ls $LS_OPTIONS -lA --time-style="+%Y-%m-%d %H:%M:%S"'\''' \ -e '$a PS1='\''${debian_chroot:+($debian_chroot)}\\342\\224\\214 \\[\\033[01;33m\\h\\[\\033[00m\\] @ \\[\\033\[01;35m\\u\\\[\\033\[00m\\\] @ \\[\\033[01;31m\\]\`date +"%Y-%m-%d %H:%M:%S"\` \\[\\033[00m\\]@\\[\\033[01;32m\\] $(echo \`/sbin/ip a | grep inet | grep -v -E "inet6|127.0.0.1|docker" | cut -d " " -f 6 | cut -d "/" -f 1\`)\\[\\033[00m\\] : \\[\\033[01;34m\\]\\w\\[\\033[00m\\] \\n\\342\\224\\224\\342\\224\\200\\342\\224\\200\\342\\206\\243 \\$ '\''' \ -e '$a PS1="\\[\\033]0;$(echo \`/sbin/ip a | grep inet | grep -v -E "inet6|127.0.0.1|docker" | cut -d " " -f 6 | cut -d "/" -f 1\`): \\a\\]$PS1"' \ -i ~/.bashrc source ~/.bashrc
source ~/.bashrc
-
修改语言环境
cat /etc/locale.gen | grep UTF-8 | grep -E "en_US|zh_CN"
sed -e 's|^# en_US.UTF-8 UTF-8|en_US.UTF-8 UTF-8|g' \ -e 's|^# zh_CN.UTF-8 UTF-8|zh_CN.UTF-8 UTF-8|g' \ -i /etc/locale.gen
locale-gen
localectl localectl set-locale en_US.UTF-8 localectl
-
修改时区
timedatectl timedatectl set-timezone Asia/Shanghai timedatectl
-
修改更新源
sed -e 's|^|#|g' \ -e '$a\\ndeb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware' \ -e '$a\deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware' \ -e '$a\deb https://mirrors.ustc.edu.cn/debian-security/ stable-security main contrib non-free non-free-firmware' \ -i /etc/apt/sources.list
-
查看有效的更新源
cat /etc/apt/sources.list | grep -v -E "^.*#|^$"
-
更新系统
apt update && apt upgrade -y --fix-missing && apt autoremove -y && apt dist-upgrade && apt full-upgrade
-
消除命令行记录
sed -e '$a\\nsource /etc/bash.bashrc' -i /etc/profile history -c
二、安装 Transmission
apt install -y transmission-daemon
三、修改 Transmission 配置文件
-
停止 transmission 服务
# 停止服务 systemctl stop transmission-daemon.service
-
修改配置
- 禁用DHT
sed -e '/dht-enabled/{ s/true/false/}' -i /etc/transmission-daemon/settings.json
- 取消 web 登录需要密码
sed -e '/rpc-authentication-required/{ s/true/false/}' -i /etc/transmission-daemon/settings.json
- 允许其他网段登录web页面
sed -e '/rpc-whitelist-enabled/{ s/true/false/}' -i /etc/transmission-daemon/settings.json
- 启用域名进行访问
sed -e '/rpc-host-whitelist-enabled/{ s/true/false/}' -i /etc/transmission-daemon/settings.json
- 禁用DHT
-
启动 transmission 服务
# 启动服务 systemctl start transmission-daemon.service
三、安装 Transmission 中文远程 web 客户端
- 下载中文远程 web 客户端
wget -c https://github.com/ronggang/transmission-web-control/archive/refs/tags/v1.6.1-update1.tar.gz
- 进行解压
tar xvfz v1.6.1-update1.tar.gz
- 拷贝文件
cp -a -r transmission-web-control-1.6.1-update1/src/. /usr/share/transmission/web/
四、访问 Transmission
<http://192.168.124.89:9091/>