#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
文章來源于領測軟件測試網 http://www.kjueaiud.com/