diff --git a/05.PVE制作虚拟机模板.md b/05.PVE制作虚拟机模板.md index 9077bb4..0f2fe8d 100644 --- a/05.PVE制作虚拟机模板.md +++ b/05.PVE制作虚拟机模板.md @@ -279,10 +279,10 @@ $ sudo systemctl status systemd-timesyncd.service CGroup: /system.slice/systemd-timesyncd.service └─4540 /usr/lib/systemd/systemd-timesyncd -Aug 27 17:03:12 DNST01 systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization... -Aug 27 17:03:13 DNST01 systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization. -Aug 27 17:03:13 DNST01 systemd-timesyncd[4540]: Contacted time server 203.107.6.88:123 (ntp.aliyun.com). -Aug 27 17:03:13 DNST01 systemd-timesyncd[4540]: Initial clock synchronization to Wed 2025-08-27 17:03:13.200663 CST. +Aug 27 17:03:12 TPL01 systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization... +Aug 27 17:03:13 TPL01 systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization. +Aug 27 17:03:13 TPL01 systemd-timesyncd[4540]: Contacted time server 203.107.6.88:123 (ntp.aliyun.com). +Aug 27 17:03:13 TPL01 systemd-timesyncd[4540]: Initial clock synchronization to Wed 2025-08-27 17:03:13.200663 CST. ``` ### 1.8.配置自动更新 @@ -420,20 +420,14 @@ $ sudo bash -c 'apt clean && apt autoclean && apt autoremove --purge' ## 清理系统缓存 $ sudo bash -c 'find /var/cache/apt/ /var/lib/apt/lists/ /tmp/ -type f -print -delete' -## 清理 SmartDNS 缓存(按需) -$ sudo bash -c 'find /var/cache/smartdns/ /var/lib/smartdns/ -type f -print -delete' - ## 重置机器标识符 $ sudo truncate -s 0 /etc/machine-id /var/lib/dbus/machine-id ## 清理系统日志 $ sudo bash -c 'find /var/log/ -type f -print -delete' -## 清理命令历史记录文件 -$ rm -rvf ~/.bash_history ~/.zsh_history ~/.zcompdump* && history -c - -## 关闭系统 -$ sudo shutdown now +## 清理命令历史记录文件并关闭系统 +$ rm -rvf ~/.bash_history ~/.zsh_history ~/.zcompdump* && history -c && sudo shutdown now ``` ## 2.虚拟机转为模板 diff --git a/06.PVE制作DNS服务器.md b/06.PVE制作DNS服务器.md index 6847df2..e9072c9 100644 --- a/06.PVE制作DNS服务器.md +++ b/06.PVE制作DNS服务器.md @@ -482,5 +482,24 @@ server=127.0.0.1#6053 ``` -至此,新虚拟机已配置完成,重启后即可作为内网 DNS 服务器使用。 +## 7.清理系统 + +内网 DNS 服务器已部署配置完毕,正式投产前,可按需对系统进行清理优化。 + +```bash +## 清理系统软件包 +$ sudo bash -c 'apt clean && apt autoclean && apt autoremove --purge' + +## 清理系统缓存 +$ sudo bash -c 'find /var/cache/apt/ /var/lib/apt/lists/ /tmp/ -type f -print -delete' + +## 清理 SmartDNS 缓存、持久化数据文件(WebUI 自定义密码存储于此文件) +$ sudo bash -c 'find /var/cache/smartdns/ /var/lib/smartdns/ -type f -print -delete' + +## 清理系统日志 +$ sudo bash -c 'find /var/log/ -type f -print -delete' + +## 清理命令历史记录文件并关闭系统 +$ rm -rvf ~/.bash_history ~/.zsh_history ~/.zcompdump* && history -c && sudo shutdown now +``` diff --git a/07.PVE制作TS服务器.md b/07.PVE制作TS服务器.md index cd0961e..727b3a2 100644 --- a/07.PVE制作TS服务器.md +++ b/07.PVE制作TS服务器.md @@ -425,18 +425,13 @@ $ sudo systemctl status nftables.service $ sudo systemctl enable nftables.service ``` -修改 `nftables` 配置文件,执行以下命令。 +由于防火墙规则内容较多,请打开文件 [debian_ts_nftables.conf](./src/debian/debian_ts_nftables.conf) ,复制全文内容,完整替换 `nftables` 配置文件中的现有配置。 ```bash -## 备份 nftables 配置文件 -$ sudo mv /etc/nftables.conf /etc/nftables.conf.bak - -## 创建新的 nftables 配置文件 +## 编辑 nftables 配置文件 $ sudo editor /etc/nftables.conf ``` -由于防火墙配置文件很长,因此请查阅文件 [debian_ts_nftables.conf](./src/debian/debian_ts_nftables.conf) 进行复制。 - 配置完成后,需重启 `nftables.service` 服务。 ```bash