hhktonybutbueatiful.blog.chinaunix.net
But_Bueatiful
个人Blog: hhktony.com
全部博文(553)
Virtual(2)
Memory_layout(3)
LinK_List(3)
DEBUG(6)
Struct_Union(1)
String(3)
Num_Storage(1)
Pointer(4)
Function(11)
Key_Word(7)
Bit_operation(1)
Test_questions(8)
Array(8)
Reading(1)
Pthread(6)
File_I/O(1)
Process(7)
IPC(2)
GUI_Developme(2)
Socket(13)
Behaviour(5)
File_System(7)
Disk_Storage(1)
Problem-solving(5)
Text_tools(9)
Firefox(4)
Emacs(0)
Start-up(1)
System_File(10)
Grub(9)
Reading(18)
Command(43)
SofeWare(20)
Workmanship(22)
VIM(32)
tftp(2)
NFS(1)
gpm(1)
Samba(2)
FTP(4)
SELinux(3)
Protocol(5)
Elements(3)
Skill(5)
Command(4)
Software(11)
Problem(2)
WIN Skills(8)
USB Skills(4)
Reading(6)
Programming(14)
Shell_Script(8)
u-boot(1)
arm裸机开发(4)
Environment(1)
Skyeye(0)
2015年(1)
2014年(2)
2013年(12)
2012年(384)
2011年(154)
weisheng
hutugui0
pursue19
元元七月
35598013
zchmary
junfeng1
drfxiaol
fumumusa
zealouss
张三13aw
xiaoxifu
tiancai9
wb123456
Sea05973
xb_0916
GeraldW
snow888
分类: LINUX
2012-04-23 01:33:28
建议根据自己的实际需要来修改此脚本,不要盲目使用!
点击(此处)折叠或打开#!/bin/sh# desc: setup linux system security# author:coralzd# powered by # 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.sonauth required pam_tally.so onerr=fail deny=3 unlock_time=300nauth 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_configsed -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`doif [ ! -x $i ];thenecho "$i not found,no md5sum!"elsemd5sum $i >> /var/log/`hostname`.logfidonerm -f list
点击(此处)折叠或打开
上一篇:常用命令速查备忘
下一篇:实用的iptables shell脚本
重返人生2012-04-24 10:26:21
Linux的系统安全设置Shell脚本还是比较值得学习的啊,可以再写的具体点啊
☆彼岸★花开2012-04-23 19:58:32
不用有太大的改动吧,基本都差不多的说
登录 注册