关闭Linux系统中不需要的服务Shell脚本

vi /etc/service_stop.sh

  1. #!/bin/bash
  2. # This script is used to del some service is not used on the server
  3. service microcode_ctl stop
  4. chkconfig --level 235 microcode_ctl off
  5. service gpm stop
  6. chkconfig --level 235 gpm off
  7. service kudzu stop
  8. chkconfig --level 235 kudzu off
  9. service netfs stop
  10. chkconfig --level 235 netfs off
  11. service rawdevices stop
  12. chkconfig --level 235 rawdevices off
  13. service saslauthd stop
  14. chkconfig --level 235 saslauthd off
  15. service keytable stop
  16. chkconfig --level 235 keytable off
  17. service mdmonitor stop
  18. chkconfig --level 235 mdmonitor off
  19. service atd stop
  20. chkconfig --level 235 atd off
  21. service irda stop
  22. chkconfig --level 235 irda off
  23. service psacct stop
  24. chkconfig --level 235 psacct off
  25. service apmd stop
  26. chkconfig --level 235 apmd off
  27. service isdn stop
  28. chkconfig --level 235 isdn off
  29. service iptables stop
  30. chkconfig --level 235 iptables off
  31. service ip6tables stop
  32. chkconfig --level 235 ip6tables off
  33. service pcmcia stop
  34. chkconfig --level 235 pcmcia off
  35. service sendmail stop
  36. chkconfig --level 235 sendmail off
  37. service smartd stop
  38. chkconfig --level 235 smartd off
  39. service autofs stop
  40. chkconfig --level 235 autofs off
  41. service netdump stop
  42. chkconfig --level 235 netdump off
  43. service portmap stop
  44. chkconfig --level 235 portmap off
  45. service nfs stop
  46. chkconfig --level 235 nfs off
  47. service nfslock stop
  48. chkconfig --level 235 nfslock off
  49. service snmptrapd stop
  50. chkconfig --level 235 snmptrapd off
  51. service rhnsd stop
  52. chkconfig --level 235 rhnsd off
  53. service xinetd stop
  54. chkconfig --level 235 xinetd off
  55. service cups stop
  56. chkconfig --level 235 cups off
  57. service snmpd stop
  58. chkconfig --level 235 snmpd off
  59. service vncserver stop
  60. chkconfig --level 235 vncserver off
  61. service hpoj stop
  62. chkconfig --level 235 hpoj off
  63. service xfs stop
  64. chkconfig --level 235 xfs off
  65. service ntpd stop
  66. chkconfig --level 235 ntpd off
  67. service winbind stop
  68. chkconfig --level 235 winbind off
  69. service smb stop
  70. chkconfig --level 235 smb off
  71. service dc_client stop
  72. chkconfig --level 235 dc_client off
  73. service dc_server stop
  74. chkconfig --level 235 dc_server off
  75. service httpd stop
  76. chkconfig --level 235 httpd off
  77. service aep1000 stop
  78. chkconfig --level 235 aep1000 off
  79. service bcm5820 stop
  80. chkconfig --level 235 bcm5820 off
  81. service squid stop
  82. chkconfig --level 235 squid off
  83. service named stop
  84. chkconfig --level 235 named off
  85. service tux stop
  86. chkconfig --level 235 tux off
  87. service vsftpd stop
  88. chkconfig --level 235 vsftpd off
  89. service avahi-daemon stop
  90. chkconfig --level 235 avahi-daemon off
  91. service bluetooth stop
  92. chkconfig --level 235 bluetooth off
  93. service firstboot stop
  94. chkconfig --level 235 firstboot off
  95. service lvm2-monitor stop
  96. chkconfig --level 235 lvm2-monitor off
  97. service mcstrans stop
  98. chkconfig --level 235 mcstrans off
  99. service pcscd stop
  100. chkconfig --level 235 pcscd off
  101. service restorecond stop
  102. chkconfig --level 235 restorecond off
  103. service rpcgssd stop
  104. chkconfig --level 235 rpcgssd off
  105. service rpcidmapd stop
  106. chkconfig --level 235 rpcidmapd off
复制代码

chmod +x /root/service_stop.sh

#执行脚本关闭不需要的服务
/root/service_stop.sh

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值