Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 安全配置手冊 19 條鐵律:BIOS/LILO/賬戶/密碼/服務/Wrapper/審計/權限/啟動腳本/資訊隱藏/SUID/SysRq

編輯:Linux 教學

從韌體到應用層,19 條可落地的安全硬化項目,構建纵深防御體系。

  1. BIOS 密碼:防止修改啟動順序從軟碟/USB 啟動繞過系統安全
  2. LILO 密碼保護:
    /etc/lilo.conf:
    timeout=00
    restricted
    password=
    # chmod 600 /etc/lilo.conf
    # /sbin/lilo -v
    # chattr +i /etc/lilo.conf
  3. 刪除預設無用賬戶/組:userdel/groupdel 清理 lp、sync、shutdown、halt、news、uucp、operator、games、gopher 等
  4. 密碼最小長度 8 位:/etc/login.defs PASS_MIN_LEN 8
  5. 啟用 Shadow 密碼:pwconv、grpconv,/etc/shadow 權限 600
  6. Root 閒置自動登出:/etc/profile TMOUT=3600 (1h),個別用戶可在 ~/.bashrc 覆蓋
  7. 回收普通用戶控制台關機權限:rm -f /etc/security/console.apps/<service> (shutdown/reboot/halt)
  8. 關閉/卸載非必要 inetd 服務:
    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
  9. TCP Wrappers 白名單模式:
    /etc/hosts.deny: ALL: ALL@ALL, PARANOID
    /etc/hosts.allow: ftp: 202.54.15.99 foo.com
    tcpdchk  # 配置檢查
  10. 禁止遠程登入顯示系統資訊:in.telnetd -h (僅顯示 login: 提示)
  11. /etc/host.conf 防欺騙:
    order bind,hosts
    multi on
    nospoof on
  12. 免疫 /etc/services:chattr +i /etc/services
  13. 限制 root 登入終端:編輯 /etc/securetty,註釋不需的 tty
  14. 限制 su 提權:/etc/pam.d/su 添加 auth required pam_wheel.so group=wheel,僅 wheel 組可 su root
  15. 縮減 Shell 歷史並登出清空:
    /etc/profile: HISTFILESIZE=30 HISTSIZE=30
    /etc/skel/.bash_logout: rm -f $HOME/.bash_history
  16. 禁用 Ctrl+Alt+Del 重啟:/etc/inittab 註釋 ca::ctrlaltdel:/sbin/shutdown -t3 -r now → /sbin/init q
  17. 啟動腳本權限收斂:chmod -R 700 /etc/rc.d/init.d/*
  18. 隱藏系統版本資訊:
    # /etc/rc.d/rc.local 註釋所有 echo 到 /etc/issue
    rm -f /etc/issue /etc/issue.net
  19. 清理非必要 SUID/SGID:
    find / -type f \( -perm -04000 -o -perm -02000 \) -exec ls -lg {} \;
    chmod a-s 
  20. 持續性:以上非一次性動作,需納入基線巡檢、變更管理、應急預案

19 條鐵律,構建 Linux 纵深防御基線。

Copyright © Windows教程網 All Rights Reserved