linux優化

更改yum源

mv -f /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

安裝基本服務

yum install -y net-snmp ntp openssh-clients  gcc gcc-c++ openssl-devel vim lrzsz unzip rsync

關閉selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
cat /etc/selinux/config|grep SELINUX=disabled
setenforce 0
getenforce

在這裏插入圖片描述
關閉centos7防火牆

systemctl stop firewalld.service
systemctl enable firewalld

時間同步

echo '* 0 * * * /usr/sbin/ntpdate cn.pool.ntp.org' &>/dev/null >>/var/spool/cron/root
crontab -l

在這裏插入圖片描述
提高linux內核打開文件數量

echo '* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535' >>/etc/security/limits.conf
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章