ubuntu安装qibtorrent

佚名 2021-6-2 1,396 6/2

在Ubuntu 18.04服务器上安装qBittorrent

你可以在Ubuntu 18.04服务器上安装qBittorrent命令行客户端,并通过qBittorrent Web界面进行管理(可以在Web浏览器中控制它),SSH进入你的Ubuntu 18.04服务器并使用相同的PPA安装qBittorrent守护程序:

apt-get install software-properties-common
sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
sudo apt install qbittorrent-nox

请注意,我们需要安装qbittorrent-nox(没有X),而不是qbittorrent。qBittorrent-nox旨在通过其功能丰富的Web UI进行控制,该UI可在http://localhost:8080上默认访问,Web UI访问是安全的,默认帐户用户名是admin,adminadmin作为密码,你可以使用以下命令启动qBitorrent-nox:

qbittorrent-nox

但是,建议不要以这种方式启动qBittorrent-nox,因为在运行时无法运行其他命令。按Ctrl+C立即退出。我们可以创建一个systemd服务单元,以便它可以在后台运行,也可以在系统启动时启动。

创建qbittorrent-nox用户和组,以便它可以作为非特权用户运行,这将提高服务器的安全性:

sudo adduser --system --group qbittorrent-nox
  • -system标志意味着我们正在创建系统用户而不是普通用户,系统用户没有密码,无法登录,这是你想要的torrent客户端,将为该用户创建主目录/home/qbittorent-nox。你可以使用以下命令将你的用户帐户添加到组qbittorrent-nox,以便用户帐户可以访问qBittorrent-nox下载的文件,文件默认下载到/home/qbittorrent-nox/Downloads/,请注意,需要重新登录才能使组更改生效:
sudo adduser root qbittorrent-nox

然后文本编辑器(如nano)为qbittorrent-nox创建一个systemd服务文件:

sudo vim /etc/systemd/system/qbittorrent-nox.service

将以下行复制并粘贴到文件中。

[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
#Do not change to "simple"
Type=forking
User=qbittorrent-nox
Group=qbittorrent-nox
UMask=007
ExecStart=/usr/bin/qbittorrent-nox -d
Restart=on-failure
[Install]
WantedBy=multi-user.target

要在Nano文本编辑器中保存文件,请按Ctrl+O,然后按Enter确认,按Ctrl+X退出,现在使用以下命令启动qBittorrent-nox:

sudo systemctl start qbittorrent-nox

请注意,如果更改systemd服务文件,则需要重新加载systemd守护程序才能使更改生效:

sudo systemctl daemon-reload

你可能还希望在系统引导时启用自动启动:

sudo systemctl enable qbittorrent-nox

检查其状态:

systemctl status qbittorrent-nox
- THE END -

佚名

7月11日16:57

最后修改:2021年7月11日
0

非特殊说明,本博所有文章均为博主原创。

共有 0 条评论