mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-09-01 14:32:53 +08:00
更新文案描述
This commit is contained in:
+31
-18
@@ -8,7 +8,7 @@
|
||||
|
||||
因为 Debian 的云镜像默认使用 SSH 秘钥登录,因此切换到左侧菜单的 `控制台` 进行登录。
|
||||
|
||||

|
||||

|
||||
|
||||
在虚拟机的命令行界面,使用 `vim` 编辑器编辑 `sshd` 服务的配置文件,执行以下命令。
|
||||
|
||||
@@ -53,7 +53,6 @@ $ sudo systemctl restart ssh.service
|
||||
|
||||
```bash
|
||||
## 配置 Debian 系统默认软件源脚本
|
||||
|
||||
$ sudo bash -c 'cat > /etc/apt/sources.list.d/debian.sources <<EOF
|
||||
Types: deb
|
||||
URIs: https://mirrors.ustc.edu.cn/debian
|
||||
@@ -162,6 +161,20 @@ Press <enter> to keep the current choice[*], or type selection number: 2
|
||||
update-alternatives: using /usr/bin/nvim to provide /usr/bin/editor (editor) in manual mode
|
||||
```
|
||||
|
||||
若需完全禁用 `neovim` 鼠标功能;即关闭所有鼠标交互,右键行为完全交给终端 / 控制台处理,需执行以下命令。
|
||||
|
||||
```bash
|
||||
## 创建 nvim 配置目录
|
||||
$ sudo mkdir -p /etc/xdg/nvim
|
||||
|
||||
## 配置 nvim 鼠标交互行为脚本
|
||||
$ sudo tee /etc/xdg/nvim/sysinit.vim << 'EOF'
|
||||
set mouse=
|
||||
|
||||
EOF
|
||||
|
||||
```
|
||||
|
||||
### 1.6.调整内核参数
|
||||
|
||||
由于该虚拟机将作为内网 DNS 服务器的克隆模板,需调整内核参数以优化性能。
|
||||
@@ -177,7 +190,7 @@ $ sudo editor /etc/sysctl.d/99-sysctl.conf
|
||||
|
||||
```bash
|
||||
# This configuration file is customized by fox,
|
||||
# Optimize sysctl parameters for local DNS server.
|
||||
# Optimize sysctl parameters for local TPL server.
|
||||
|
||||
kernel.panic = 20
|
||||
kernel.panic_on_oops = 1
|
||||
@@ -226,7 +239,7 @@ $ sudo timedatectl set-timezone Asia/Shanghai
|
||||
$ date -R
|
||||
|
||||
#### 系统时间示例输出
|
||||
Wed, 27 Aug 2025 17:02:17 +0800
|
||||
Mon, 10 Aug 2026 11:23:56 +0800
|
||||
```
|
||||
|
||||
Debian 云镜像默认使用 `systemd-timesyncd.service` 同步时间,且需要调整为使用国内 NTP 服务器。
|
||||
@@ -268,21 +281,21 @@ $ sudo systemctl status systemd-timesyncd.service
|
||||
#### NTP 服务示例输出
|
||||
● systemd-timesyncd.service - Network Time Synchronization
|
||||
Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; preset: enabled)
|
||||
Active: active (running) since Wed 2025-08-27 17:03:13 CST; 6s ago
|
||||
Invocation: 7dcb974725ac43638a4ae3df51644f84
|
||||
Active: active (running) since Mon 2026-08-10 11:24:43 CST; 5s ago
|
||||
Invocation: 95cd4555913e45d8a7235347cf3d571a
|
||||
Docs: man:systemd-timesyncd.service(8)
|
||||
Main PID: 4540 (systemd-timesyn)
|
||||
Main PID: 6516 (systemd-timesyn)
|
||||
Status: "Contacted time server 203.107.6.88:123 (ntp.aliyun.com)."
|
||||
Tasks: 2 (limit: 2317)
|
||||
Memory: 1.5M (peak: 2.2M)
|
||||
CPU: 261ms
|
||||
Tasks: 2 (limit: 2189)
|
||||
Memory: 1.6M (peak: 2.3M)
|
||||
CPU: 136ms
|
||||
CGroup: /system.slice/systemd-timesyncd.service
|
||||
└─4540 /usr/lib/systemd/systemd-timesyncd
|
||||
└─6516 /usr/lib/systemd/systemd-timesyncd
|
||||
|
||||
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.
|
||||
Aug 10 11:24:43 TPL01 systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization...
|
||||
Aug 10 11:24:43 TPL01 systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.
|
||||
Aug 10 11:24:43 TPL01 systemd-timesyncd[6516]: Contacted time server 203.107.6.88:123 (ntp.aliyun.com).
|
||||
Aug 10 11:24:43 TPL01 systemd-timesyncd[6516]: Initial clock synchronization to Mon 2026-08-10 11:24:43.569158 CST.
|
||||
```
|
||||
|
||||
### 1.8.配置自动更新
|
||||
@@ -306,7 +319,7 @@ $ sudo dpkg-reconfigure -plow unattended-upgrades
|
||||
<Yes>
|
||||
```
|
||||
|
||||
进一步调整 `20auto-upgrades` 配置文件。
|
||||
开始调整 `20auto-upgrades` 配置文件。
|
||||
|
||||
```bash
|
||||
## 编辑 20auto-upgrades 配置文件
|
||||
@@ -334,7 +347,7 @@ APT::Periodic::CleanInterval "1";
|
||||
$ sudo editor /etc/apt/apt.conf.d/50unattended-upgrades
|
||||
```
|
||||
|
||||
因为该配置文件很长,完整的配置文件可查看 [debian_dns_50unattended_upgrades.conf](./src/debian/debian_dns_50unattended_upgrades.conf) 以便对比。
|
||||
因为该配置文件很长,完整的配置文件可查看 [debian_tpl_50unattended_upgrades.conf](./src/debian/debian_tpl_50unattended_upgrades.conf) 以便对比。
|
||||
|
||||
```bash
|
||||
## 删除以下行前面的注释符 // ,代表启用
|
||||
@@ -405,7 +418,7 @@ $ sudo crontab -e
|
||||
```bash
|
||||
## 定时任务配置项
|
||||
|
||||
30 4 8,24 * * /usr/sbin/reboot
|
||||
30 4 8,24 * * /usr/sbin/shutdown --reboot now
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user