- yum -y install wget
- mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- cd /etc/yum.repos.d/
- wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
- yum clean all
- yum makecache
- yum -y install mailx mlocate lsof vim make gcc gcc-c++ unzip dos2unix openssh-clients dos2unix
- #安装setup(可选)
- yum install setuptool ntsysv system-config-firewall-tui system-config-network-tui
- #关闭selinux
- sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
- setenforce 0
- #关闭IPV6(重启生效)
- cat >> /etc/modprobe.conf <<EOF
- alias net-pf-10 off
- alias ipv6 off
- EOF
- #设置SSH
- sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
- sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
- service sshd restart
- #set the file limit
- echo "ulimit -SHn 102400" >> /etc/rc.local
- cat >> /etc/security/limits.conf << EOF
- * soft nofile 65535
- * hard nofile 65535
- EOF
- #系统允许创建的最大进程数量
- vim /etc/security/limits.d/90-nproc.conf
- /etc/security/limits.d/90-nproc.conf
- 修改
- * soft nproc 4096
CentOS最小化安装-优化
最新推荐文章于 2021-04-20 20:27:51 发布