基線linux
linux常用基線
#! /bin/bash cp /etc/login.defs /etc/login.defs.bak sed -i '/PASS_MAX_DAYS/'d /etc/login.defs sed -i '/PASS_MIN_DAYS/'d /etc/login.defs sed -i '/PASS_MIN_LEN/'d /etc/login.defs sed -i '/PASS_WARN_AGE/'d /etc/login.defs sed -i '$aPASS_MAX_DAYS 90' /etc/login.defs sed -i '$aPASS_MIN_DAYS 10' /etc/login.defs sed -i '$aPASS_MIN_LEN 8' /etc/login.defs sed -i '$aPASS_WARN_AGE 7' /etc/login.defs cp /etc/profile /etc/profile.bak sed -i '/TMOUT/'d /etc/profile sed -i '$aexport TMOUT=300' /etc/profile source /etc/profile sed -i '$aumask 027' /etc/profile source /etc/profile cp /etc/pam.d/passwd /etc/pam.d/passwd.bak sed -i '$apassword required pam_pwquality.so retry=3' /etc/pam.d/passwd echo 'change password Strategy' cp /etc/security/pwquality.conf /etc/security/pwquality.conf.bak sed -i '/minlen/'d /etc/security/pwquality.conf sed -i '/dcredit/'d /etc/security/pwquality.conf sed -i '/ucredit/'d /etc/security/pwquality.conf sed -i '/lcredit/'d /etc/security/pwquality.conf sed -i '/ocredit/'d /etc/security/pwquality.conf sed -i '$aminlen = 8' /etc/security/pwquality.conf sed -i '$adcredit = -1' /etc/security/pwquality.conf sed -i '$aucredit = -1 ' /etc/security/pwquality.conf sed -i '$alcredit = -1 ' /etc/security/pwquality.conf sed -i '$aocredit = -1' /etc/security/pwquality.conf sed -i '$a * soft core 0' /etc/security/limits.conf sed -i '$a * hard core 0' /etc/security/limits.conf sed -i '$aauth sufficient pam_rootok.so' /etc/pam.d/su sed -i '$aauth required pam_wheel.so use_uid' /etc/pam.d/su chmod 644 /etc/passwd chmod 400 /etc/shadow chmod 644 /etc/group chmod 644 /etc/services chmod 600 /etc/xinetd.conf chmod 600 /etc/security chmod 644 /etc/passwd chmod 600 /etc/shadow chmod 644 /etc/group chattr +a /var/log/messages
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2837529/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- GNU/Linux安全基線與加固-0.1Linux
- 基於linux下unzip離線安裝Linux
- 基於linux離線部署nginx,使用rpmLinuxNginx
- Linux基礎命令---lftp連線ftp伺服器LinuxFTP伺服器
- 【Linux基礎教程】常用的Python MySQL連線庫有哪些?LinuxPythonMySql
- 【Linux基礎】Linux目錄Linux
- linux基礎Linux
- linux,ssh連線Linux
- CobaltStrike上線LinuxLinux
- 線性基
- Linux基礎配置Linux
- linux 命令 基礎Linux
- Linux基礎命令Linux
- Linux 程式基礎Linux
- linux基礎操作Linux
- 配置pycharm連線linuxPyCharmLinux
- linux配置連線xshellLinux
- linux連線window cmdLinux
- linux 網線共享wifiLinuxWiFi
- 線性基模板
- Nginx安全基線Nginx
- vnc遠端連線linux,vnc遠端連線linux的具體操作VNCLinux
- vnc遠端連線linux,vnc遠端連線linux的具體方法。VNCLinux
- Linux學習路線全解,Linux作業系統學習路線Linux作業系統
- 無基線不安全!淺談安全基線檢查
- Linux基礎命令—mkswapLinux
- Linux基礎命令---mknodLinux
- Linux基礎命令---mkfsLinux
- Linux基礎命令---mktempLinux
- Linux基礎命令---sudoLinux
- Linux基礎命令---yesLinux
- Linux基礎命令---shutdownLinux
- Linux基礎命令---serviceLinux
- Linux基礎命令—sudoLinux
- Linux基礎命令—calLinux
- Linux基礎命令—dateLinux
- Linux基礎命令—lastLinuxAST
- Linux基礎命令---dateLinux