CentOS系统环境精简优化详解
CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一,它是来自于Red Hat Enterprise Linux依照开放源代码规定释出的源代码所编译而成。接下来是小编为大家收集的CentOS系统环境精简优化详解,希望能帮到大家。
CentOS系统环境精简优化详解
第一步、删除不必要的自带软件包
学习啦在线学习网 yum remove Deployment_Guide-en-US finger cups-libs cups ypbind
学习啦在线学习网 yum remove bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils
yum remove sendmail* samba* talk-server finger-server bind* xinetd
学习啦在线学习网 yum remove nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools
yum remove syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools
学习啦在线学习网 yum groupremove "Mail Server" "Games and Entertainment" "X Window System" "X Software Development"
学习啦在线学习网 yum groupremove "Development Libraries" "Dialup Networking Support"
yum groupremove "Games and Entertainment" "Sound and Video" "Graphics" "Editors"
yum groupremove "Text-based Internet" "GNOME Desktop Environment" "GNOME Software Development"
第二步、升级centos系统
yum update #更新系统
yum clean all #清理全部缓存文件
学习啦在线学习网 第三步、禁用seLinux
sestatus #先执行看seLinux状态,如果不是disabled,就需要执行下面步骤,否则不要执行
学习啦在线学习网 vi /etc/selinux/config
SELINUX=disabled #禁用SeLinux
SELINUX=enforcing #使用SeLinux
学习啦在线学习网 第四步、禁止IPV6(执行后需要reboot重启)
vi /etc/modprobe.conf #打开文件,把下面两行加到最后
学习啦在线学习网 alias net-pf-10 off
alias ipv6 off
第五步、初始化防火墙
touch /etc/sysconfig/iptables
iptables -F
学习啦在线学习网 iptables -X
iptables -Z
学习啦在线学习网 service iptables save
service iptables restart
第六步、禁止无用服务
学习啦在线学习网 #! /bin/bash
service acpid off
service atd stop
学习啦在线学习网 service auditd stop
service avahi-daemon stop
service avahi-dnsconfd stop
学习啦在线学习网 service bluetooth stop
学习啦在线学习网 service conman stop
service cpuspeed stop
service cups stop
service dnsmasq stop
service dund stop
service firstboot stop
service hidd stop
学习啦在线学习网 service httpd stop
service ibmasm stop
学习啦在线学习网 service ip6tables stop
学习啦在线学习网 service irda stop
service kdump stop
学习啦在线学习网 service lm_sensors stop
service mcstrans stop
service messagebus stop
service microcode_ctl stop
service netconsole stop
service netfs stop
学习啦在线学习网 service netplugd stop
service nfs stop
学习啦在线学习网 service nfslock stop
service nscd stop
学习啦在线学习网 service ntpd stop
学习啦在线学习网 service oddjobd stop
学习啦在线学习网 service pand stop
service pcscd stop
学习啦在线学习网 service portmap stop
service psacct stop
service rdisc stop
学习啦在线学习网 service restorecond stop
学习啦在线学习网 service rpcgssd stop
学习啦在线学习网 service rpcidmapd stop
学习啦在线学习网 service rpcsvcgssd stop
service saslauthd stop
service sendmail stop
学习啦在线学习网 service setroubleshoot stop
service smb stop
service vncserver stop
service winbind stop
学习啦在线学习网 service wpa_supplicant stop
service xfs stop
学习啦在线学习网 service ypbind stop
service yum-updatesd stop
chkconfig acpid off
chkconfig atd off
chkconfig auditd off
chkconfig avahi-daemon off
chkconfig avahi-dnsconfd off
学习啦在线学习网 chkconfig bluetooth off
学习啦在线学习网 chkconfig conman off
学习啦在线学习网 chkconfig cpuspeed off
学习啦在线学习网 chkconfig cups off
chkconfig dnsmasq off
学习啦在线学习网 chkconfig dund off
chkconfig firstboot off
学习啦在线学习网 chkconfig hidd off
chkconfig httpd off
chkconfig ibmasm off
chkconfig ip6tables off
学习啦在线学习网 chkconfig irda off
学习啦在线学习网 chkconfig kdump off
学习啦在线学习网 chkconfig lm_sensors off
chkconfig mcstrans off
chkconfig messagebus off
学习啦在线学习网 chkconfig microcode_ctl off
chkconfig netconsole off
chkconfig netfs off
学习啦在线学习网 chkconfig netplugd off
学习啦在线学习网 chkconfig nfs off
学习啦在线学习网 chkconfig nfslock off
学习啦在线学习网 chkconfig nscd off
chkconfig ntpd off
chkconfig oddjobd off
chkconfig pand off
学习啦在线学习网 chkconfig pcscd off
学习啦在线学习网 chkconfig portmap off
chkconfig psacct off
chkconfig rdisc off
chkconfig restorecond off
学习啦在线学习网 chkconfig rpcgssd off
学习啦在线学习网 chkconfig rpcidmapd off
学习啦在线学习网 chkconfig rpcsvcgssd off
学习啦在线学习网 chkconfig saslauthd off
学习啦在线学习网 chkconfig sendmail off
chkconfig setroubleshoot off
学习啦在线学习网 chkconfig smb off
chkconfig vncserver off
chkconfig winbind off
学习啦在线学习网 chkconfig wpa_supplicant off
学习啦在线学习网 chkconfig xfs off
学习啦在线学习网 chkconfig ypbind off
chkconfig yum-updatesd off
学习啦在线学习网 这样通过上述6步骤,就可以完成对centos精简和优化。
看了“CentOS系统环境精简优化详解”还想看: