首页 » Linux » 装机之后,基本优化脚本

装机之后,基本优化脚本

 

装机之后,我们需要对防火墙、yum源、时间同步,必要的软件,开机启动软件进行相关优化,可以做成脚本如下:

 

[root@clc321 scripts]# cat jibenyouhua.sh
 #!/bin/bash
 /bin/sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
 /etc/init.d/iptables stop
 cd /etc/yum.repos.d/ && mv CentOS-Base.repo CentOS-Base.repo.bak.`date +%F` \
 && wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo \
 && yum clean all && yum makecache
 /usr/bin/yum -y install lrzsz tree ntpdate sysstat nmap
for n in `chkconfig --list |grep 3:on|awk '{print $1}'`
 do
 chkconfig --level 3 $n off
 done
for n in sshd crond rsyslog network
 do
 chkconfig --level 3 $n on
 done
 /bin/echo '* - nofile 65535' >> /etc/security/limits.conf

原文链接:装机之后,基本优化脚本,转载请注明来源!

0