Skip to content

🔒 防火墙与安全

防火墙工具

  • iptables: 底层防火墙工具(复杂)。
  • firewalld (CentOS): 动态防火墙管理器。
    • firewall-cmd --add-port=80/tcp --permanent
  • ufw (Ubuntu): 简易防火墙 (Uncomplicated Firewall)。
    • ufw allow 80

安全增强

  • SELinux / AppArmor: 强制访问控制 (MAC) 机制。
  • SSH 配置 (/etc/ssh/sshd_config):
    • 禁用 Root 登录 (PermitRootLogin no).
    • 修改默认端口.
    • 使用密钥登录,禁用密码登录。

Released under the MIT License.