以下是CentOS Stream 8的關鍵安全設置技巧:
sudo dnf update
,確保系統及軟件包修補安全漏洞。firewalld
:sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=ssh # 開放SSH端口
sudo firewall-cmd --reload
adm
、lp
),鎖定非必要超級用戶:sudo userdel username
sudo passwd -l username
/etc/login.defs
設置 PASS_MIN_LEN 10
。sudo chattr +i /etc/passwd /etc/shadow
。cups
、bluetooth
):sudo systemctl stop service_name
sudo systemctl disable service_name
root
可管理關鍵服務。root
遠程登錄:修改 /etc/ssh/sshd_config
,設置 PermitRootLogin no
。auditd
服務記錄關鍵操作:sudo systemctl enable auditd
。/var/log/
下的日志文件,監控異常行為。net.ipv4.tcp_syncookies=1
)抵御SYN攻擊,編輯 /etc/sysctl.conf
。root
登錄終端,通過編輯 /etc/securetty
指定允許的終端。注意:CentOS Stream 8 已停止官方支持,建議優先遷移至 CentOS Stream 9 或其他長期支持發行版以獲取持續安全更新。
參考來源: