快速业务通道

EMOS1.3安装后的相关安全设置

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-15
ostfix$(date %Y%m%d).sql >> $LogFile 2>&1
echo "[$NewFile]Backup Success!" >> $LogFile
rm -rf $DumpFile
fi

######################################################################
# backup mail''s user directories and files #
###################################################################### 拥有帝国一切,皆有可能。欢迎访问phome.net
MailFileBk=$Mail_bk_dir/mail$(date %Y%m%d).tgz
OldMailFileBk=$Mail_bk_dir/mail$(date %Y%m%d --date=''14 days ago'').tgz

if [ -f $OldMailFileBk ]
then
rm -rf $OldMailFileBk
fi

if [ -f $MailFileBk ]
then
echo "[$MailFileBk]The Backup File is exists,Can''t Backup!" >> $LogFile
else
cd /home
tar czf $MailFileBk domains >> $LogFile 2>&1
fi

echo "-------------------------------------------" >> $LogFile #*********************************************************************************************************8
#4、内核优化脚本(/usr/local/bin/kernel_optimize)
chmod x /usr/local/bin/kernel_optimize ----添加执行权限
echo "/usr/local/bin/kernel_optimize" >> /etc/rc.local --开机自动运行
#!/bin/bash
#kernel optimize optimize ,create by 2008-10-07

#enable broadcast echo protection
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts #deny ping
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

#disble source routed packets
#for f in /proc/sys/net/ipv4/conf/*/accept_source_rout; do
# echo 0 > $f
#done

#enable tcp syn cookie protection
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

#disable icmp redirect acceptance
for f in /proc/sys/net/ipv4/conf/*/accept_redirects; do
echo 0 > $f
done

#don''t send redirect messages
for f in /proc/sys/net/ipv4/conf/*/send_redirects; do
echo 0 > $f
done

#drop spoofed packets
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo 1 > $f
done

#log packets with impossible addresses
for f in /proc/sys/net/ipv4/conf/*/log_martians; do
echo 1 > $f
done #******************************************************************************************************** 拥有帝国一切,皆有可能。欢迎访问phome.net
#5、防火墙设置脚本(/usr/local/bin/firewall)
chmod x /usr/local/bin/firewall ---添加执行权限
echo "/usr/local/bin/firewall " >> /etc/rc.local ---开机自动运行
#!/bin/bash
#this is a common firewall created by 2008-10-7

#define some variable
IPT=/sbin/iptables
CONNECTION_TRACKING="1"
INTERNET="eth0"
CLASS_A="10.0.0.0/8"
CLASS_B="172.16.0.0/12"
CLASS_C="192.168.0.0/16"
CLASS_D_MULTICAST="224.0.0.0/4"
CLASS_E_RESERVED_NET="240.0.0.0/5"
BROADCAST_SRC="0.0.0.0"
BROADCAST_DEST="255.255.255.255"
IPADDR=220. 94.58.245
LOOPBACK_INTERFACE="lo"

#Remove any existing rules
$IPT -F
$IPT -X

#setting default firewall policy
$IPT --policy OUTPUT ACCEPT
$IPT --policy FORWARD DROP
$IPT -P INPUT DROP


#stop firewall
if [ "$1" = "stop" ]
then
echo "Filewall completely stopped!no firewall running!"
exit 0
fi

#setting for loopback interface
$IPT -A INPUT -i lo -j ACCEPT
$IPT -A OUTPUT -o lo -j ACCEPT

# S

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号