标签:linux centos 安装后优化 配置 操作系统 调优
添加普通用户,通过sudo授权管理
port 52113
UseDNS no
PermitRootLogin no
PermitEmptyPasswords no
GSSAPIAuthentication no
/usr/sbin/ntpdate time.nist.gov
echo ‘*/5 * * * * /usr/sbin/ntpdate time.nist.gov‘ &>/dev/null
[root@localhost ~]# cat /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
[root@localhost ~]# ^C
[root@localhost ~]# echo $LANG
EN
[root@localhost ~]#
调整文件描述符的数量,进程及文件的打开都会消耗文件描述符
查看 ulimit –n
临时加大 ulimit -HSn 65535
永久配置 /etc/security/limits.conf
echo "* - nofile 65535">>/etc/security/limits.conf
注销重新登录
根据要求 如果是大量并发建议关闭防火墙,前端使用硬件防火墙
防火墙优化
net.nf_conntrack_max = 25000000
net.netfilter.nf_conntrack_max = 25000000
net.netfilter.nf_conntrack_tcp_timeout_established = 180
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_colse_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120
关闭 vim /etc/selinux/config SELINUX=disabled
配置文件/etc/sysctl.conf
刷新sysctl -p
net.ipv4.tcp_fin_timeout = 2
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_keepalived_time = 600
net.ipv4.ip_local_port_range = 4000 65000
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 36000
net.ipv4.route.gz_timeout = 100
net.ipv4.tcp_syn_retries = 1
net.core.somaxconn = 16384
net.core.netdev_max_backlog = 16384
net.ipv4.tcp_max_orphans = 16384
vim /etc/issue修改文件
>/etc/issue 清空
echo "">/etc/redhat.release
vim /etc/motd
chattr +i /etc/passwd /etc/shadow /etc/group /etc/gshadow /etc/inittab
lsattr /etc/passwd 查看文件属性
修改chattr命令的名字
mv /usr/bin/charttr /usr/bin/lock (自己能记住)
本文出自 “火拳艾斯” 博客,请务必保留此出处http://xinzong.blog.51cto.com/10018904/1693399
标签:linux centos 安装后优化 配置 操作系统 调优
原文地址:http://xinzong.blog.51cto.com/10018904/1693399