Centos 6系统优化

Centos 6 系统优化

1.系统安装的包 最小化安装时,自定义额外包组Base,Compatibility libraries,Debugging Tools,Development tools. 自定义额外包 tree nmap sysstat lrzsz dos2unix telnet

2.外网ip 10.0.0.6 nat模式 内外ip 172.16.0.6 lan段

详见http://blog.51cto.com/life2death/1618744

3.yum源

[1]wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

[2]wget -O /etc/yum.repos.d/epel.repo

http://mirrors.aliyun.com/repo/epel-6.repo

4.关闭selinux和iptables

sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config

/etc/init.d/iptables stop

5.ssh问题

vi /etc/ssh/sshd_config

PermitEmptyPasswords no

UseDNS no

GSSAPIAuthentication no

6.精简开机系统服务

for zhangcun in `chkconfig --list|grep "3:启用"|awk '{print $1}'|grep -vE "crond|network|rsyslog|sshd|sysstat"`;do chkconfig $zhangcun off;done

这条命令的意思是排除crond|network|rsyslog|sshd|sysstat这五个服务,其他的全部关闭    

7.时间同步

/usr/sbin/ntpdate time.nuri.net

echo '#time sync by zhangcun at 2017-03-08' >> /var/spool/cron/root

echo '*/5 * * * * /usr/sbin/ntpdate time.nuri.net >/dev/null 2>&1' >> /var/spool/cron/root

8.字符集

cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori

echo 'LANG="zh_CN.UTF-8"' > /etc/sysconfig/i18n

source /etc/sysconfig/i18n

echo $LANG

9.文件描述符

echo '* - nofile 65535' >> /etc/security/limits.conf

 

猜你喜欢

转载自blog.csdn.net/qq_41781322/article/details/79498673