[shell] linux系统安全shell第二版
来源:互联网 发布:jdk 8 linux x64.rpm 编辑:程序博客网 时间:2024/06/06 03:54
转载地址http://bbs.linuxtone.org/forum.php?mod=viewthread&tid=10318
#!/bin/sh# desc: setup linux system security# author:coralzd# powered by www.freebsdsystem.org# version 0.1.2 written by 2011.05.03#account setuppasswd -l xfspasswd -l newspasswd -l nscdpasswd -l dbuspasswd -l vcsapasswd -l gamespasswd -l nobodypasswd -l avahipasswd -l haldaemonpasswd -l gopherpasswd -l ftppasswd -l mailnullpasswd -l pcappasswd -l mailpasswd -l shutdownpasswd -l haltpasswd -l uucppasswd -l operatorpasswd -l syncpasswd -l admpasswd -l lp# chattr /etc/passwd /etc/shadowchattr +i /etc/passwdchattr +i /etc/shadowchattr +i /etc/groupchattr +i /etc/gshadow# add continue input failure 3 ,passwd unlock time 5 minitesed-i 's#auth required pam_env.so#auth required pam_env.so\nauth required pam_tally.so onerr=fail deny=3 unlock_time=300\nauth required /lib/security/$ISA/pam_tally.so onerr=fail deny=3 unlock_time=300#' /etc/pam.d/system-auth# system timeout 5 minite auto logoutecho "TMOUT=300" >>/etc/profile# will system save history command list to 10sed -i "s/HISTSIZE=1000/HISTSIZE=10/" /etc/profile# enable /etc/profile go!source /etc/profile# add syncookie enable /etc/sysctl.confecho "net.ipv4.tcp_syncookies=1" >> /etc/sysctl.confsysctl -p # exec sysctl.conf enable# optimizer sshd_configsed -i "s/#MaxAuthTries 6/MaxAuthTries 6/" /etc/ssh/sshd_config sed -i "s/#UseDNS yes/UseDNS no/" /etc/ssh/sshd_config# limit chmod important commandschmod 700 /bin/pingchmod 700 /usr/bin/fingerchmod 700 /usr/bin/whochmod 700 /usr/bin/wchmod 700 /usr/bin/locatechmod 700 /usr/bin/whereischmod 700 /sbin/ifconfigchmod 700 /usr/bin/picochmod 700 /bin/vichmod 700 /usr/bin/whichchmod 700 /usr/bin/gccchmod 700 /usr/bin/makechmod 700 /bin/rpm# history securitychattr +a /root/.bash_historychattr +i /root/.bash_history# write important command md5cat > list << "EOF" && /bin/ping/bin/finger/usr/bin/who/usr/bin/w/usr/bin/locate/usr/bin/whereis/sbin/ifconfig/bin/pico/bin/vi/usr/bin/vim/usr/bin/which/usr/bin/gcc/usr/bin/make/bin/rpmEOFfor i in `cat list`do if [ ! -x $i ];then echo "$i not found,no md5sum!" else md5sum $i >> /var/log/`hostname`.log fidone rm -f list
- [shell] linux系统安全shell第二版
- Linux的系统安全设置Shell脚本
- Linux shell第二讲
- Linux Shell第二期
- Linux常用命令(第二版) --Shell应用技巧
- 增加系统安全的shell脚本
- shell 命令学习-系统安全1
- CentOS系统安全设置Shell脚本
- linux第二节SHELL脚本
- 《Linux程序设计第四版》读书笔记 - 第二章 Shell程序设计
- Linux shell脚本功略第2版笔记--第二章
- linux shell编程指南第二十四章------shell嵌入命令
- linux shell编程指南第二十六章------shell 工具
- linux shell编程指南第二十六章------shell 工具1
- Linux Shell 编程 第二部分 chapter7-12
- Linux程序设计读书笔记:第二章 shell程序设计
- linux 程序设计笔记 第二章 shell
- Linux程序设计第二章 shell程序设计 笔记
- FileUtils
- VMware.Workstation Linux与windows实现文件夹共享
- ios 内存管理原则及exec_back_assess调试
- 总算解决了swfupload在非IE(chrome firefox opera)统统不能用的问题
- FusionCharts等产品简介
- [shell] linux系统安全shell第二版
- windows 7下如何为netsh命令加入routing选项
- UBoot的工作
- Libgdx中文社区开始招募版主了!
- C#制作WinForm控件
- Spring获得初始化容器
- CSS控制的内容超过容器宽度后显示省略号
- AspectJ切入点语法详解
- GoldenGate系列一:快速搭建单向同步GoldenGate环境