From b93497fbed58197855bad179a5c393b978eca81a Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Mon, 9 Nov 2026 22:29:57 +0800 Subject: [PATCH] chore: modify workflows & Commands.md --- .gitea/workflows/deploy.yaml | 2 +- ...ds-for-Server-Operation-and-Maintenance.md | 36 ++++++++++++++----- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 7d570ab..5941472 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -6,7 +6,7 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - name: Server pull maria config file from remote + - name: Pull from remote & Upload artifacts to Aliyun OSS uses: appleboy/ssh-action@v1.2.5 with: host: "100.114.118.48" diff --git a/docs/tech/Commands-for-Server-Operation-and-Maintenance.md b/docs/tech/Commands-for-Server-Operation-and-Maintenance.md index fa3875b..87ca1fc 100644 --- a/docs/tech/Commands-for-Server-Operation-and-Maintenance.md +++ b/docs/tech/Commands-for-Server-Operation-and-Maintenance.md @@ -162,14 +162,28 @@ ssh-copy-id -p 25800 ... **修改 SSH 配置** -``` bash -sudo nano /etc/ssh/sshd_config +```bash +sudo tee /etc/ssh/sshd_config.d/00-user.conf >/dev/null <<'EOF' +Port 25800 +PermitRootLogin prohibit-password +PubkeyAuthentication yes +PasswordAuthentication no +KbdInteractiveAuthentication no +AuthenticationMethods publickey +EOF + +sudo chown root:root /etc/ssh/sshd_config.d/00-user.conf +sudo chmod 644 /etc/ssh/sshd_config.d/00-user.conf ``` -- Port 22 → **Port 25800** -- PermitRootLogin **prohibit-password** (取消该行注释) -- PasswordAuthentication yes → PasswordAuthentication **no** -- (可选) PubkeyAuthentication **yes** +**检查 SSH 配置** + +```bash +# 检查配置语法 +sudo /usr/sbin/sshd -t +# 查看配置是否正确生效 +sudo /usr/sbin/sshd -T +``` 重启 SSH 服务以刷新配置: `sudo systemctl restart ssh` @@ -269,9 +283,12 @@ echo 'alias flexget="/root/flexget/bin/flexget -c /root/flexget/config.yml"' >> | 1 | 8090 | / | / | / | UpSnap | | 1 | 9090 | / | / | / | One-KVM [^1] | -[^1]: 服务器 1 的 One-KVM 与 Uptime Kuma 都在容器内。可能由于容器间的网络有特殊限制,One-KVM 需要在宿主机处开放端口,才能让 Uptime Kuma 正常访问。 +| 服务器 | 端口 | 来源IP/IP段 | 目标IP/IP段 | 协议 | 备注 | +| :----: | :---: | :------------: | :---------: | :---: | :---: | +| 3-1 | 8080 | 192.168.1.0/24 | / | / | Dagu | -*CatTomServer3-1 无非标端口开放。* + +[^1]: 服务器 1 的 One-KVM 与 Uptime Kuma 都在容器内。可能由于容器间的网络有特殊限制,One-KVM 需要在宿主机处开放端口,才能让 Uptime Kuma 正常访问。 **Maria 非标端口开放表** @@ -314,7 +331,10 @@ sudo ufw allow 7100 # Example 2 sudo ufw allow from 127.0.0.1 to any port 18080 # Example 3 +sudo ufw allow from 192.168.1.0/24 to any port 8080 +# Example 4 sudo ufw allow 6888/udp + ``` ``` bash