伺服器上線前的基準配置決定生存率。針對常見的 Windows 2000 Server 與 FreeBSD,提供關鍵加固清單。
C:\Inetpub\wwwroot.ida .idq .idc .shtm .shtml .printerFreeBSD 安裝預設僅開 22 (SSH) 與 25 (Sendmail)。Sendmail 歷史漏洞多,建議停用。
# /etc/rc.conf
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
PermitRootLogin no、PasswordAuthentication no(強制金鑰登入)、Port 2222(非預設埠)。sysrc -a | grep _enable 檢視並停用無需 daemon。/etc/sysctl.conf 加入:net.inet.tcp.blackhole=2(丟棄關閉埠 SYN)net.inet.udp.blackhole=1kern.securelevel=1(單用戶模式才能降低)nosuid,noexec,nodev(/tmp、/var/tmp、/home)。dump/rsync 異地備份,驗證可還原。基準配置完成後,掃描驗證(Nessus/OpenVAS),建立基線快照,後續變更皆納入變更管理流程。