CentOS系統環境精簡最佳化
第一步、刪除不必要的自帶軟體包
yum -y remove Deployment_Guide-en-US finger cups-libs cups ypbind bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils sendmail* samba* talk-server finger-server bind* xinetd nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools
yum -y groupremove "Mail Server" "Games and Entertainment" "X Window System" "X Software Development"
yum -y groupremove "Development Libraries" "Dialup Networking Support"
yum -y groupremove "Games and Entertainment" "Sound and Video" "Graphics" "Editors"
yum -y groupremove "Text-based Internet" "GNOME Desktop Environment" "GNOME Software Development"
第二步、升級centos系統
yum -y update //更新系統
yum clean all //清理全部快取檔案
第三步、禁用seLinux
sestatus //執行seLinux查看狀態,如果不是disabled,就需要執行下面步驟,否則不要執行
vim /etc/selinux/config
SELINUX=disabled //禁用SeLinux
SELINUX=enforcing //使用SeLinux
第四步、禁止IPV6(執行後需要reboot重啟)
vim /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精簡和最佳化
yum -y remove Deployment_Guide-en-US finger cups-libs cups ypbind bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils sendmail* samba* talk-server finger-server bind* xinetd nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools
yum -y groupremove "Mail Server" "Games and Entertainment" "X Window System" "X Software Development"
yum -y groupremove "Development Libraries" "Dialup Networking Support"
yum -y groupremove "Games and Entertainment" "Sound and Video" "Graphics" "Editors"
yum -y groupremove "Text-based Internet" "GNOME Desktop Environment" "GNOME Software Development"
第二步、升級centos系統
yum -y update //更新系統
yum clean all //清理全部快取檔案
第三步、禁用seLinux
sestatus //執行seLinux查看狀態,如果不是disabled,就需要執行下面步驟,否則不要執行
vim /etc/selinux/config
SELINUX=disabled //禁用SeLinux
SELINUX=enforcing //使用SeLinux
第四步、禁止IPV6(執行後需要reboot重啟)
vim /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精簡和最佳化
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9034054/viewspace-2072987/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RedHat/CentOs系統搭建lnmp環境RedhatCentOSLNMP
- Docker 實戰之 CentOS7 系統環境配置DockerCentOS
- CentOS7系統手動部署LNMP環境操作演示CentOSLNMP
- CentOS6系統Apache環境配置SSL證書教程CentOSApache
- CentOS7系統搭建web環境 php&nginx&pgsqlCentOSWebPHPNginxSQL
- Linux系統CentOS 7配置Spring Boot執行環境LinuxCentOSSpring Boot
- CentOS6系統原始碼安裝LNMP環境詳解CentOS原始碼LNMP
- Vagrant 搭建 CentOS 環境CentOS
- CentOS 配置 PHP 環境CentOSPHP
- JAVA 環境配置 CentOSJavaCentOS
- centos 前端環境搭建CentOS前端
- centos搭建virtualenv環境CentOS
- nginx手動安裝基於類centos系統環境安裝NginxCentOS
- Win10系統怎麼精簡 教你輕鬆精簡Win10系統Win10
- Linux CentOS7 系統中部署 Nginx + PHP-fpm + MySQL 環境LinuxCentOSNginxPHPMySql
- Linux系統 Centos7 環境基於Docker部署Rocketmq服務LinuxCentOSDockerMQ
- 5、CentOS 6.5系統安裝配置Nginx-1.2.7+PHP-5.3.22環境CentOSNginxPHP
- Linux系統環境搭建Linux
- EAS系統環境的搭建
- unix系統環境檢查
- CentOS python環境配置CentOSPython
- Centos下搭建golang環境CentOSGolang
- Centos 安裝 erlang 環境CentOS
- Linux環境下的Mysql資料庫入門-基於Centos系統LinuxMySql資料庫CentOS
- linux或者CentOS環境下安裝.NET Core環境LinuxCentOS
- linux系統環境變數Linux變數
- Linux 系統環境監測Linux
- ECShop 2.7.2 的系統環境要求
- CentOS7 環境配置指南CentOS
- CentOS 7.6虛擬環境搭建CentOS
- centos下編譯lnmp環境CentOS編譯LNMP
- CentOS環境變數設定CentOS變數
- 公寓系統+精簡版系統加入功能和修改功能
- CentOS6環境配置Linux GFS+LVM叢集檔案系統CentOSLinuxLVM
- CentOS 6.5系統基礎最佳化附帶最佳化指令碼CentOS指令碼
- 分散式系統與叢集環境分散式
- 作業系統的執行環境作業系統
- RAC環境調整系統時間