NAS常用软件及配置方法

基于Debian13配置

  1. 移除自动更新服务的程序apt remove needrestart
  2. 更改文件权限为最低chown -R nobody:nogroup backup

1. 安装软件

1.1 常用的工具

vim nano git sudo zsh curl wget lsof htop tree fzf autojump lrzsz smartmontools

1.2 常用应用软件

proxychains4 plocate docker.io docker-cli docker-compose

2. 更改shell安装Oh My Zsh 管理 zsh 配置。

https://github.com/ohmyzsh/ohmyzsh

1
2
3
4
# curl
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
# wget
sh -c "$(wget -O- https://install.ohmyz.sh/)"

2.1 安装Oh My Zsh 常用插件。

https://github.com/zsh-users

1
2
3
4
5
#语法高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

#自动补全
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

2.2 Oh My Zsh的配置文件。

编辑~/.zshrc文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
export ZSH="$HOME/.oh-my-zsh"
#root用户
ZSH_THEME="ys"
#User用户
#ZSH_THEME="bira"

HIST_STAMPS="mm/dd/yyyy"

plugins=(git cp zsh-interactive-cd extract history autojump zsh-autosuggestions zsh-syntax-highlighting)
#plugins=(sudo z zsh-history-substring-search.zsh zsh-completions command-not-found colored-man-pages safe-paste)

alias update="apt update && apt upgrade -y"
#alias ls="exa -l"
#alias rm='trash-put'
#alias rmclean='trash-empty'
#alias rmrest='trash-restore'
#alias rml='trash-list'
#alias rmrm='trash-rm'
## trash-cli 常用功能
## trash-put 将文件或目录移入回收站
## trash-empty 清空回收站
## trash-list 列出回收站中的文件
## trash-restore 还原回收站中的文件
## trash-rm 删除回首站中的单个文件
alias gpush='git add . && git commit -m "$(date +%Y-%m-%d_%H:%M:%S)" && git push'
alias lastb='journalctl -u ssh | grep "Failed"'
source $ZSH/oh-my-zsh.sh

3. v2ray代理

V2Fly.org
GitHub - v2fly/fhs-install-v2ray

3.1 安装应用

apt install -y v2ray

3.2 开机自启动

systemctl enable v2ray --now

3.3 备份配置文件

cp /etc/v2ray/config.json{,-backup}

3.4 更改配置文件

nano /etc/v2ray/config.json

3.5 服务端配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"inbounds": [
{
"port": 55180,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "fd5c7194-e66c-4f23-aaa0-a2c4c75dc3df"
}
]
}
},
{
"port": 1081,
"listen": "100.123.45.67",
"protocol": "http",
"settings": {}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}

[!TIP]
Linux 可以使用命令 cat /proc/sys/kernel/random/uuid 来生成id。
"listen": "100.123.45.67",这里是 VPS 的 Tailscale IP,允许Tailscale网络直接使用http代理。
3.6 客户端配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"inbounds": [
{
"port": 1081,
"listen": "127.0.0.1",
"protocol": "http",
"settings": {}
},
{
"port": 1082,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "88.88.88.88",
"port": 55180,
"users": [
{
"id": "fd5c7194-e66c-4f23-aaa0-a2c4c75dc3df",
"alterId": 0,
"security": "auto"
}
]
}
]
}
}
]
}

[!TIP]
"address": "88.88.88.88",这里是 VPS 的公网IP。
3.4 测试代理

  • 测试VPS的http代理(仅允许tailscale内网使用)
    curl -x http://100.104.66.71:1081 -I https://www.google.com
  • 测试本地http代理
    curl -x http://127.0.0.1:1081 -I https://www.google.com
  • 测试本地socks代理
    curl -x socks5h://127.0.0.1:1082 -I https://www.google.com
    3.5 终端使用代理
    编辑配置文件
    nano /etc/proxychains4.conf
    1
    2
    3
    4
    5
    6
    7
    8
    #本地代理(通过v2ray的vmess协议)
    #socks5 127.0.0.1 1082
    #http 127.0.0.1 1081
    #远程代理(直连VPS)
    #http 100.104.66.71 1081
    #局域网代理
    #socks5 172.16.31.31 7891
    #http 172.16.31.31 7891
    proxychains apt xxxxx
    3.6 docker使用代理
    创建docker.service.d目录
    1
    mkdir -p /etc/systemd/system/docker.service.d

使用 tee 命令直接创建带内容的文件

1
2
3
4
5
6
tee /etc/systemd/system/docker.service.d/http-proxy.conf << 'EOF'
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:1081"
Environment="HTTPS_PROXY=http://127.0.0.1:1081"
Environment="NO_PROXY=localhost,127.0.0.1,.local,.cn"
EOF

3.7 测试拉取镜像

1
docker pull hello-word

4. samba共享配置

安装应用

apt install -y samba

禁止nmbd(局域网发现)开机自启

systemctl disable nmbd

开机smbd(主程序)自启动

systemctl enable smbd --now

备份配置文件
cp /etc/samba/smb.conf{,-backup}

添加配置
nano /etc/samba/smb.conf

1
2
3
4
5
6
7
8
9
10
[Public]
path = /mnt/backup/1-2024-03-15
public = yes
writable = yes

[User]
path = /mnt/backup/1-2024-03-18
browseable = yes
valid users = koicc
writable = yes

允许匿名用户写入

chown -R nobody:nogroup /mnt/backup/1-2024-03-15

设置 Samba 密码
sudo smbpasswd -a koicc

重载配置

systemctl daemon-reload

重启应用

systemctl restart smbd

查看应用状态

systemctl status smbd

5. transmission下载管理

5.1 安装应用

apt install -y transmission-daemon

5.2 开机自启动

systemctl enable transmission-daemon --now

5.3 更改程序运行权限

nano /usr/lib/systemd/system/transmission-daemon.service

1
2
3
4
[Service]
#User=debian-transmission
User=koicc
Group=koicc

5.4 备份配置文件

cp /etc/transmission-daemon/settings.json{,-backup}

5.5 更改配置文件

nano /etc/transmission-daemon/settings.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
"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,
"announce-ip": "",
"announce-ip-enabled": false,
"anti-brute-force-enabled": true,
"anti-brute-force-threshold": 5,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 128,
"default-trackers": "",
"dht-enabled": false,
"download-dir": "/home/koicc/Downloads/pt/movie",
"download-queue-enabled": false,
"download-queue-size": 5,
"encryption": 0,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/home/koicc/Downloads/pt/incomplete",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-limit-global": 500,
"peer-limit-per-torrent": 100,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "le",
"pex-enabled": false,
"pidfile": "",
"port-forwarding-enabled": true,
"preallocation": 2,
"preferred_transport": "utp",
"prefetch-enabled": true,
"proxy_url": "",
"queue-stalled-enabled": false,
"queue-stalled-minutes": 30,
"ratio-limit": 2.0,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"reqq": 2000,
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-host-whitelist": "",
"rpc-host-whitelist-enabled": false,
"rpc-password": "{25d6eeaeb0c865b62a86093e72ae00e8e9e8e97bhBNWTEYE",
"rpc-port": 9091,
"rpc-socket-mode": "0750",
"rpc-url": "/transmission/",
"rpc-username": "koicc",
"rpc-whitelist": "127.0.0.1,::1",
"rpc-whitelist-enabled": false,
"scrape-paused-torrents-enabled": true,
"script-torrent-added-enabled": false,
"script-torrent-added-filename": "",
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"script-torrent-done-seeding-enabled": false,
"script-torrent-done-seeding-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"sequential_download": false,
"sleep-per-seconds-during-verify": 100,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"start_paused": false,
"tcp-enabled": true,
"torrent-added-verify-mode": "fast",
"trash-original-torrent-files": true,
"umask": "022",
"upload-slots-per-torrent": 5,
"utp-enabled": true,
"watch-dir": "/home/koicc/Downloads/pt/watch",
"watch-dir-enabled": true,
"watch-dir-force-generic": false
}

5.6 重载配置

systemctl daemon-reload

5.7 重启应用

systemctl restart transmission-daemon

5.8 查看应用状态

systemctl status transmission-daemon

5.9 创建目录 + 设置所有者 + 设置读写权限

1
mkdir -p /home/koicc/Downloads/pt/{incomplete,movie,watch} && chown -R koicc:koicc /home/koicc/Downloads/pt && chmod -R 755 /home/koicc/Downloads/pt

6. qbittorrent下载管理

6.1 安装应用

apt install -y qbittorrent-nox

6.2 开机自启动

systemctl enable qbittorrent-nox@koicc --now

6.3 隐藏BT提示信息

nano /usr/lib/systemd/system/qbittorrent-nox@.service

1
2
3
4
5
6
7
[Service]
Type=simple
PrivateTmp=false
User=%i
#ExecStart=/usr/bin/qbittorrent-nox
ExecStart=/usr/bin/qbittorrent-nox --confirm-legal-notice
TimeoutStopSec=1800

6.4 备份配置文件

cp /home/koicc/.config/qBittorrent/qBittorrent.conf{,-backup}

6.5 更改配置文件

nano /home/koicc/.config/qBittorrent/qBittorrent.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[Application]
FileLogger\Age=1
FileLogger\AgeType=1
FileLogger\Backup=true
FileLogger\DeleteOld=true
FileLogger\Enabled=false
FileLogger\MaxSizeBytes=66560
FileLogger\Path=/home/koicc/.local/share/qBittorrent/logs

[BitTorrent]
MergeTrackersEnabled=true
Session\AddExtensionToIncompleteFiles=true
Session\DHTEnabled=false
Session\DisableAutoTMMByDefault=false
Session\ExcludedFileNames=
Session\IgnoreLimitsOnLAN=true
Session\LSDEnabled=false
Session\MaxConnections=-1
Session\MaxConnectionsPerTorrent=-1
Session\MaxUploads=-1
Session\MaxUploadsPerTorrent=-1
Session\PeXEnabled=false
Session\Port=48411
Session\QueueingSystemEnabled=false
Session\SSL\Port=28168
Session\TempPathEnabled=true
Session\UseCategoryPathsInManualMode=true
Session\uTPRateLimited=false

[Core]
AutoDeleteAddedTorrentFile=IfAdded

[LegalNotice]
Accepted=true

[Meta]
MigrationVersion=8

[Network]
Cookies=@Invalid()
PortForwardingEnabled=false

[Preferences]
MailNotification\req_auth=true
WebUI\AuthSubnetWhitelist=172.16.31.0/24, 192.168.6.0/24, 192.168.88.0/24
WebUI\AuthSubnetWhitelistEnabled=true
WebUI\CSRFProtection=false
WebUI\ClickjackingProtection=false
WebUI\HostHeaderValidation=false
WebUI\LocalHostAuth=false
WebUI\Password_PBKDF2="@ByteArray(kUG+fsV7K14Yy5z8J2m5Lw==:ZFNmLfcFFfYHSsrb0A1TJIyRTPkIDbbXLLjHh7l7Vctqd83JvsTe7e1AkV/gg41W/067QSkW8umuH8rAPPPCaQ==)"
WebUI\Port=9092
WebUI\SecureCookie=false
WebUI\Username=koicc

[RSS]
AutoDownloader\DownloadRepacks=false
AutoDownloader\EnableProcessing=true
AutoDownloader\SmartEpisodeFilter=s(\\d+)e(\\d+), (\\d+)x(\\d+), "(\\d{4}[.\\-]\\d{1,2}[.\\-]\\d{1,2})", "(\\d{1,2}[.\\-]\\d{1,2}[.\\-]\\d{4})"
Session\EnableProcessing=true

6.6 重载配置

systemctl daemon-reload

6.7 重启应用

systemctl restart qbittorrent-nox@koicc

6.8 查看应用状态

systemctl status qbittorrent-nox@koicc

https://www.qbittorrent.org/news

Tags · qbittorrent/qBittorrent · GitHub

7. syncthing文件同步

安装应用

apt install -y syncthing

开机自启动

systemctl enable syncthing@koicc --now

备份配置文件

cp /home/koicc/.local/state/syncthing/config.xml{,-backup}

更改配置文件,允许访问,添加账户密码

/home/koicc/.local/state/syncthing/config.xml

1
2
3
4
5
6
7
<gui enabled="true" tls="false" debugging="false" sendBasicAuthPrompt="false">
<address>0.0.0.0:8384</address>
<user>koicc</user>
<password>$2a$10$J3OXmAOdnfmW.3InDGgRn.Z8wz/sWK7ygUHu3LQJxyzLDQt8HMnYe</password>
<apikey>EZPH9MCMaj3jPZysME3rFV6sK3bzECYG</apikey>
<theme>default</theme>
</gui>

重载配置

systemctl daemon-reload

重启应用

systemctl restart syncthing@koicc

查看应用状态

systemctl status syncthing@koicc

https://github.com/syncthing/syncthing
https://syncthing.net/
https://apt.syncthing.net/


NAS常用软件及配置方法
http://example.com/2026/05/02/NAS网络存储/NAS常用软件及配置方法/index/
作者
秋雨夜眠
发布于
2026年5月2日
许可协议