CentOS最小化安装-优化

来源:互联网 发布:淘宝网上怎么购买东西 编辑:程序博客网 时间:2024/05/17 06:11
  1. yum -y install wget 
  2. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  3. cd /etc/yum.repos.d/
  4. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
  5. yum clean all
  6. yum makecache

  7. yum -y install mailx mlocate lsof vim make gcc gcc-c++ unzip dos2unix openssh-clients dos2unix

  8. #安装setup(可选)
  9. yum install setuptool ntsysv system-config-firewall-tui system-config-network-tui

  10. #关闭selinux
  11. sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
  12. setenforce 0

  13. #关闭IPV6(重启生效)
  14. cat >> /etc/modprobe.conf <<EOF
  15. alias net-pf-10 off
  16. alias ipv6 off
  17. EOF

  18. #设置SSH
  19. sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
  20. sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
  21. service sshd restart

  22. #set the file limit
  23. echo "ulimit -SHn 102400" >> /etc/rc.local
  24. cat >> /etc/security/limits.conf << EOF
  25. *           soft   nofile       65535
  26. *           hard   nofile       65535
  27. EOF

  28. #系统允许创建的最大进程数量
  29. vim /etc/security/limits.d/90-nproc.conf
  30. /etc/security/limits.d/90-nproc.conf
  31. 修改
  32. *  soft  nproc  4096
原创粉丝点击