NAS常用软件及配置方法
基于Debian13配置
- 移除自动更新服务的程序
apt remove needrestart - 更改文件权限为最低
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 配置。
1 | |
2.1 安装Oh My Zsh 常用插件。
1 | |
2.2 Oh My Zsh的配置文件。
编辑~/.zshrc文件
1 | |
3. 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 | |
[!TIP]
Linux 可以使用命令 cat /proc/sys/kernel/random/uuid 来生成id。"listen": "100.123.45.67",这里是 VPS 的 Tailscale IP,允许Tailscale网络直接使用http代理。
3.6 客户端配置
1 | |
[!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.confproxychains apt xxxxx1
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
3.6 docker使用代理
创建docker.service.d目录1
mkdir -p /etc/systemd/system/docker.service.d
使用 tee 命令直接创建带内容的文件
1 | |
3.7 测试拉取镜像
1 | |
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 | |
允许匿名用户写入
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 | |
5.4 备份配置文件
cp /etc/transmission-daemon/settings.json{,-backup}
5.5 更改配置文件
nano /etc/transmission-daemon/settings.json
1 | |
5.6 重载配置
systemctl daemon-reload
5.7 重启应用
systemctl restart transmission-daemon
5.8 查看应用状态
systemctl status transmission-daemon
5.9 创建目录 + 设置所有者 + 设置读写权限
1 | |
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 | |
6.4 备份配置文件
cp /home/koicc/.config/qBittorrent/qBittorrent.conf{,-backup}
6.5 更改配置文件
nano /home/koicc/.config/qBittorrent/qBittorrent.conf
1 | |
6.6 重载配置
systemctl daemon-reload
6.7 重启应用
systemctl restart qbittorrent-nox@koicc
6.8 查看应用状态
systemctl status qbittorrent-nox@koicc
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 | |
重载配置
systemctl daemon-reload
重启应用
systemctl restart syncthing@koicc
查看应用状态
systemctl status syncthing@koicc
https://github.com/syncthing/syncthing
https://syncthing.net/
https://apt.syncthing.net/