服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Centos - CentOS系统环境精简优化详解

CentOS系统环境精简优化详解

2019-06-15 10:40CentOS之家 Centos

今天小编将为大家带来通过6步骤,完成对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精简和优化。

延伸 · 阅读

精彩推荐
  • CentosCentOS7 阿里云的yum源使用详解

    CentOS7 阿里云的yum源使用详解

    这篇文章主要介绍了CentOS7 阿里云的yum源使用详解的相关资料,这里对备份yum源,添加EPEL源,和缓存清理,进行了介绍,需要的朋友可以参考下...

    天王9312020-12-28
  • Centos在CentOS系统上安装Docker的教程

    在CentOS系统上安装Docker的教程

    这篇文章主要介绍了在CentOS系统上安装Docker的教程,Docker是当下人气最为火热的容器类虚拟软件,需要的朋友可以参考下 ...

    开源中文社区3952019-09-17
  • Centoscentos 7中添加一个新用户并授权的步骤详解

    centos 7中添加一个新用户并授权的步骤详解

    这篇文章主要给大家介绍了关于在centos 7中添加一个新用户并授权的步骤,文中将实现的步骤介绍的非常详细,通过文中介绍的步骤可以轻松的创建一个新...

    Ryan.Miao9832022-02-12
  • CentosCentOS系统下软件包的制作方法和过程详解

    CentOS系统下软件包的制作方法和过程详解

    今天小编将为大家带来的是CentOS系统下软件包的制作方法和过程详解;希望对大家会有帮助,有需要的朋友一起去看看吧...

    CentOS之家4802019-05-30
  • CentosCentOS6.2网卡设置

    CentOS6.2网卡设置

    如果你想让服务器可以更新、让网友访问你的LINUX服务器,那一定要设置LINUX网上给网卡绑定一个IP,下面我们就介绍CentOS6.2网卡设置IP的方法。...

    CentOS教程网10092021-10-03
  • CentosCentOS上SVN服务器端程序的安装与使用教程

    CentOS上SVN服务器端程序的安装与使用教程

    SVN是一款高人气的软件项目版本控制系统,由于其在Windows的客户端的简易操作,在Git的浪潮中仍然保有很多的用户数量,这里我们就来看一下CentOS上SVN服务器端...

    cnblogs3902019-07-16
  • Centos使用Xshell连接Centos 6.6服务器操作图文教程

    使用Xshell连接Centos 6.6服务器操作图文教程

    这篇文章主要介绍了使用Xshell连接Centos 6.6服务器操作图文教程,本文用详细的操作步骤讲解了如何使用Xshell连接Centos服务器,需要的朋友可以参考下 ...

    脚本之家4032019-09-18
  • CentosCentOS 最新版本git的安装教程

    CentOS 最新版本git的安装教程

    本文主要给大家介绍了CentOS 最新版本git的安装教程,非常不错,具有参考借鉴价值,感兴趣的朋友一起看看吧...

    CentOS教程网9252021-11-29