安全最佳实践2026-03-22•阅读约 9 分钟

零信任 VPS 加固:生产环境 Linux 节点的 10 条基本规则

从 ed25519-sk 硬件安全密钥和非标准 SSH 端口,到内核 sysctl 加固和 auditd 日志,这是我们的安全检查清单。

Elena Rostova
Elena Rostova
网络安全负责人
零信任 VPS 加固:生产环境 Linux 节点的 10 条基本规则

1. 禁用密码认证和 root 登录

绝大多数自动化互联网扫描都会用字典攻击尝试 root SSH 密码。禁用 root 的 SSH 密码登录,可立即消除 99.4% 的自动化暴力破解噪音:

bash

在 /etc/ssh/sshd_config.d/99-hardened.conf 中:

PermitRootLogin prohibit-password PasswordAuthentication no ChallengeResponseAuthentication no KbdInteractiveAuthentication no UsePAM yes

2. 强制使用 Ed25519 或 FIDO2 硬件密钥

标准的 RSA 2048 密钥在现代密码学标准中已不再推荐。请采用现代的 Edwards 曲线加密(Ed25519)或硬件 FIDO2 令牌(Yubikey):

bash
ssh-keygen -t ed25519-sk -O resident -C "production-admin@nodexvps"

3. 加固内核 sysctl 网络参数

通过调整 /etc/sysctl.d/99-security.conf,防止 IP 欺骗、丢弃无效的 SYN 数据包并忽略 ICMP 广播请求:

bash
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0

使用 sudo sysctl --system 立即生效。

4. 启用 NodexVPS 云防火墙

将主机层的 UFW/nftables 与 NodexVPS 带外边缘防火墙规则结合使用,在恶意流量消耗您虚拟网卡上的任何 CPU 周期之前就将其丢弃。

#Security#Linux 加固#零信任#SSH#Sysctl

今天就开始使用 NodexVPS

按年付费立省 50%,无合约,随时可取消。