從韌體到應用層,19 條可落地的安全硬化項目,構建纵深防御體系。
/etc/lilo.conf:
timeout=00
restricted
password=
# chmod 600 /etc/lilo.conf
# /sbin/lilo -v
# chattr +i /etc/lilo.conf
userdel/groupdel 清理 lp、sync、shutdown、halt、news、uucp、operator、games、gopher 等/etc/login.defs PASS_MIN_LEN 8pwconv、grpconv,/etc/shadow 權限 600/etc/profile TMOUT=3600 (1h),個別用戶可在 ~/.bashrc 覆蓋rm -f /etc/security/console.apps/<service> (shutdown/reboot/halt)chmod 600 /etc/inetd.conf
vi /etc/inetd.conf # 註釋 ftp、telnet、shell、login、exec、talk、ntalk、imap、pop-2/3、finger、auth 等
killall -HUP inetd
chattr +i /etc/inetd.conf
/etc/hosts.deny: ALL: ALL@ALL, PARANOID
/etc/hosts.allow: ftp: 202.54.15.99 foo.com
tcpdchk # 配置檢查
in.telnetd -h (僅顯示 login: 提示)order bind,hosts
multi on
nospoof on
chattr +i /etc/services/etc/securetty,註釋不需的 tty/etc/pam.d/su 添加 auth required pam_wheel.so group=wheel,僅 wheel 組可 su root/etc/profile: HISTFILESIZE=30 HISTSIZE=30
/etc/skel/.bash_logout: rm -f $HOME/.bash_history
/etc/inittab 註釋 ca::ctrlaltdel:/sbin/shutdown -t3 -r now → /sbin/init qchmod -R 700 /etc/rc.d/init.d/*# /etc/rc.d/rc.local 註釋所有 echo 到 /etc/issue
rm -f /etc/issue /etc/issue.net
find / -type f \( -perm -04000 -o -perm -02000 \) -exec ls -lg {} \;
chmod a-s
19 條鐵律,構建 Linux 纵深防御基線。
Linux 安裝 RAID 驅動程式:使用 USB 隨身碟載入驅動映像檔實戰
SecureCRT 使用 rz/sz 實現 Linux 與 Windows 文件高速傳輸
Linux zip/unzip 壓縮解壓實用指令大全:建立、解壓、增刪檔案
Makefile 變量賦值尾隨空格導致 "command not found" 錯誤排查
Ubuntu/Linux 常見問題解決大全:啟動失敗、圖形介面、密碼遺失、磁碟空間等
Linux 伺服器網卡流量監控全方案:iftop 即時視覺化、ifconfig 統計差值腳本、SNMP 長期圖表