#chkconfig --list | grep 3:on | awk '{print "chkconfig "$1" off"}'
chkconfig kudzu offchkconfig syslog off
chkconfig netfs offchkconfig network off
chkconfig random off
chkconfig rawdevices off
chkconfig pcmcia off
chkconfig keytable off
chkconfig apmd off
chkconfig atd off
chkconfig gpm off
chkconfig autofs off
chkconfig iptables off
chkconfig isdn off
chkconfig sshd off
chkconfig portmap off
chkconfig nfslock off
chkconfig sendmail off
chkconfig rhnsd off
chkconfig crond off
chkconfig anacron off
chkconfig xfs off
chkconfig xinetd off
我们把需要保留的服务从这个列表中删除:
一般WEB服务器只留network sshd crond atd syslog
删掉相应的行以后就生成了不需要的服务删除脚本:
chkconfig kudzu off
chkconfig syslog off
chkconfig netfs off
chkconfig rawdevices off
chkconfig pcmcia off
chkconfig keytable off
chkconfig apmd off
chkconfig gpm off
chkconfig autofs off
chkconfig iptables off
chkconfig isdn off
chkconfig portmap off
chkconfig nfslock off
chkconfig sendmail off
chkconfig rhnsd off
chkconfig xfs off
chkconfig xinetd off
文章来源于领测软件测试网 https://www.ltesting.net/