#脚本名称:systemyh.sh#本脚本中需要配合一个文档来关闭不必要的服务,文档内容为不必要的服务名称#请斟酌使用本例中的stopservices.txt文档#脚本内容如下:#!/bin/bash#关闭SELinux防火墙cp/etc/sysconfig/selinux/etc/sysconfig/selinux-`date+"%Y%m%d"`sed-i‘s/SELINUX\=en..
分类:
其他好文 时间:
2015-10-28 10:56:05
阅读次数:
226
#!/bin/sh
###openiptablesservice,allowthisportsaccess80,3307,21####
functionfirewall(){
serviceiptablesstart
forPortin21803307
do
iptables-IINPUT5-mstate--stateNEW-mtcp-ptcp--dport$Port-jACCEPT
done
/etc/init.d/iptablessave
}
###disableselinuxservice##..
分类:
系统相关 时间:
2015-08-26 00:06:11
阅读次数:
313
优化内容:(1.设置history历史记录(2.添加普通用户,设置sudo权限(3.禁止root远程用户登录(4.修改远程端口(5.精简开机启动服务器(6.关闭selinux(7.配置iptables(8.修改最大连接数ulimit(9.禁止使用Ctrl+Alt+Del快捷键重启服务器(10.修改默认DNS(11.安装必要软件,更..
分类:
其他好文 时间:
2015-07-16 22:43:11
阅读次数:
282
系统优化脚本#!/bin/sh
user=alan
#shutdowniptables
chkconfigiptablesoff&&/etc/init.d/iptablesstop
#shutdownselinux
sed-i‘s/SELINUX=enforcing/SELINUX=disabled/g‘/etc/selinux/config
cat/etc/selinux/config
setenforce0
getenforce&&
#createause..
分类:
其他好文 时间:
2014-06-01 13:45:01
阅读次数:
292
#!/bin/bash#thisscriptisonlyforCentOS6#checktheOSplatform=`uname-i`if[$platform!="x86_64"];thenecho"thisscriptisonlyfor64bitOperatingSystem!"exit1fiecho"theplatformisok"version=`lsb_release-r|awk‘{printsubstr($2,1,1)}‘`if[$version!=6];thenecho"thisscriptiso..
分类:
系统相关 时间:
2014-05-03 14:51:00
阅读次数:
415