只要6步骤就可以让你的CentOS系统环境更加精简优化
2019/10/10/17:46:12 阅读:1899 来源:谷歌SEO算法 标签:
微信公众号
你是不是有时感觉装的CentOS系统太过复杂,想精简优化一下?只要简单的6个步骤,就可以精简优化你的CentOS系统环境.
第一步、删除不必要的自带软件包
- yumremoveDeployment_Guide-en-USfingercups-libscupsypbindyumremovebluez-libsdesktop-file-utilsppprp-pppoewireless-toolsirda-utilsyumremovesendmail*samba*talk-serverfinger-serverbind*xinetdyumremovenfs-utilsnfs-utils-librdatefetchmailejectkshmkbootdiskmtoolsyumremovesyslinuxtcshstartup-notificationtalkapmdrmtdumpsetserialportmapyp-toolsyumgroupremove"MailServer""GamesandEntertainment""XWindowSystem""XSoftwareDevelopment"yumgroupremove"DevelopmentLibraries""DialupNetworkingSupport"yumgroupremove"GamesandEntertainment""SoundandVideo""Graphics""Editors"yumgroupremove"Text-basedInternet""GNOMEDesktopEnvironment""GNOMESoftwareDevelopment"
第二步、升级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#打开文件,把下面两行加到最后aliasnet-pf-10offaliasipv6off
第五步、初始化防火墙
- touch/etc/sysconfig/iptablesiptables-Fiptables-Xiptables-Zserviceiptablessaveserviceiptablesrestart
第六步、禁止无用服务
- #!/bin/bashserviceacpidoffserviceatdstopserviceauditdstopserviceavahi-daemonstopserviceavahi-dnsconfdstopservicebluetoothstopserviceconmanstopservicecpuspeedstopservicecupsstopservicednsmasqstopservicedundstopservicefirstbootstopservicehiddstopservicehttpdstopserviceibmasmstopserviceip6tablesstopserviceirdastopservicekdumpstopservicelm_sensorsstopservicemcstransstopservicemessagebusstopservicemicrocode_ctlstopservicenetconsolestopservicenetfsstopservicenetplugdstopservicenfsstopservicenfslockstopservicenscdstopservicentpdstopserviceoddjobdstopservicepandstopservicepcscdstopserviceportmapstopservicepsacctstopservicerdiscstopservicerestorecondstopservicerpcgssdstopservicerpcidmapdstopservicerpcsvcgssdstopservicesaslauthdstopservicesendmailstopservicesetroubleshootstopservicesmbstopservicevncserverstopservicewinbindstopservicewpa_supplicantstopservicexfsstopserviceypbindstopserviceyum-updatesdstopchkconfigacpidoffchkconfigatdoffchkconfigauditdoffchkconfigavahi-daemonoffchkconfigavahi-dnsconfdoffchkconfigbluetoothoffchkconfigconmanoffchkconfigcpuspeedoffchkconfigcupsoffchkconfigdnsmasqoffchkconfigdundoffchkconfigfirstbootoffchkconfighiddoffchkconfighttpdoffchkconfigibmasmoffchkconfigip6tablesoffchkconfigirdaoffchkconfigkdumpoffchkconfiglm_sensorsoffchkconfigmcstransoffchkconfigmessagebusoffchkconfigmicrocode_ctloffchkconfignetconsoleoffchkconfignetfsoffchkconfignetplugdoffchkconfignfsoffchkconfignfslockoffchkconfignscdoffchkconfigntpdoffchkconfigoddjobdoffchkconfigpandoffchkconfigpcscdoffchkconfigportmapoffchkconfigpsacctoffchkconfigrdiscoffchkconfigrestorecondoffchkconfigrpcgssdoffchkconfigrpcidmapdoffchkconfigrpcsvcgssdoffchkconfigsaslauthdoffchkconfigsendmailoffchkconfigsetroubleshootoffchkconfigsmboffchkconfigvncserveroffchkconfigwinbindoffchkconfigwpa_supplicantoffchkconfigxfsoffchkconfigypbindoffchkconfigyum-updatesdoff--phpfensi.com
这样通过上述6步骤,就可以完成对centos精简和优化.
热门评论