Debian 5.0
Sponsored Link

サービスの設定2009/04/05

[1] デフォルトで有効になっている不要サービスは停止しておきます。 以下の場所にあるものがこのサイトと同じようにインストールした場合のサービス一覧です。
debian@dlp:~$
ll /etc/init.d

total 256
-rwxr-xr-x 1 root root 2344 2008-11-14 20:37 acpid
-rwxr-xr-x 1 root root 946 2008-09-23 21:29 atd
-rwxr-xr-x 1 root root 2155 2008-08-12 23:20 bootlogd
-rwxr-xr-x 1 root root 1988 2008-08-12 23:20 bootmisc.sh
-rwxr-xr-x 1 root root 3004 2008-08-12 23:20 checkfs.sh
-rwxr-xr-x 1 root root 9831 2008-08-12 23:20 checkroot.sh
-rwxr-xr-x 1 root root 6032 2008-04-16 05:42 console-screen.sh
-rwxr-xr-x 1 root root 2565 2008-09-28 20:07 cron
-rwxr-xr-x 1 root root 6593 2008-10-01 03:53 exim4
-rwxr-xr-x 1 root root 7195 2009-01-04 20:44 glibc.sh
-rwxr-xr-x 1 root root 1329 2008-08-12 23:20 halt
-rwxr-xr-x 1 root root 1287 2008-08-12 23:20 hostname.sh
-rwxr-xr-x 1 root root 4528 2008-04-29 11:36 hwclockfirst.sh
-rwxr-xr-x 1 root root 4521 2008-04-29 11:36 hwclock.sh
-rwxr-xr-x 1 root root 2518 2006-09-16 03:03 ifupdown
-rwxr-xr-x 1 root root 1046 2006-09-16 03:03 ifupdown-clean
-rwxr-xr-x 1 root root 3777 2008-04-29 16:15 keymap.sh
-rwxr-xr-x 1 root root 1484 2008-08-12 23:20 killprocs
-rwxr-xr-x 1 root root 1051 2008-11-22 00:15 lvm2
-rwxr-xr-x 1 root root 1793 2008-04-05 11:05 module-init-tools
-rwxr-xr-x 1 root root 620 2008-08-12 23:20 mountall-bootclean.sh
-rwxr-xr-x 1 root root 1956 2008-08-12 23:20 mountall.sh
-rwxr-xr-x 1 root root 2194 2008-08-12 23:20 mountdevsubfs.sh
-rwxr-xr-x 1 root root 2476 2008-08-12 23:20 mountkernfs.sh
-rwxr-xr-x 1 root root 618 2008-08-12 23:20 mountnfs-bootclean.sh
-rwxr-xr-x 1 root root 2330 2008-08-12 23:20 mountnfs.sh
-rwxr-xr-x 1 root root 1321 2008-08-12 23:20 mountoverflowtmp
-rwxr-xr-x 1 root root 3668 2008-08-12 23:20 mtab.sh
-rwxr-xr-x 1 root root 1844 2008-07-26 08:02 networking
-rwxr-xr-x 1 root root 5964 2008-10-19 14:26 nfs-common
-rwxr-xr-x 1 root root 2338 2008-12-15 10:23 openbsd-inetd
-rwxr-xr-x 1 root root 2066 2008-11-26 18:47 portmap
-rwxr-xr-x 1 root root 1247 2009-01-12 07:08 procps
-rwxr-xr-x 1 root root 10036 2008-08-12 21:33 rc
-rwxr-xr-x 1 root root 788 2008-08-12 23:20 rc.local
-rwxr-xr-x 1 root root 117 2005-12-03 02:44 rcS
-rw-r--r-- 1 root root 1510 2007-12-27 00:23 README
-rwxr-xr-x 1 root root 639 2008-08-12 23:20 reboot
-rwxr-xr-x 1 root root 941 2008-08-12 23:20 rmnologin
-rwxr-xr-x 1 root root 2850 2009-02-08 09:34 rsyslog
-rwxr-xr-x 1 root root 2283 2008-08-12 23:20 sendsigs
-rwxr-xr-x 1 root root 590 2008-08-12 23:20 single
-rw-r--r-- 1 root root 4167 2008-08-12 23:20 skeleton
-rwxr-xr-x 1 root root 525 2008-08-12 23:20 stop-bootlogd
-rwxr-xr-x 1 root root 1096 2008-08-12 23:20 stop-bootlogd-single
-rwxr-xr-x 1 root root 7473 2008-09-19 10:23 udev
-rwxr-xr-x 1 root root 1001 2008-09-19 10:23 udev-mtab
-rwxr-xr-x 1 root root 3175 2008-08-12 23:20 umountfs
-rwxr-xr-x 1 root root 2140 2008-08-12 23:20 umountnfs.sh
-rwxr-xr-x 1 root root 1456 2008-08-12 23:20 umountroot
-rwxr-xr-x 1 root root 1815 2008-08-12 23:20 urandom
-rwxr-xr-x 1 root root 1777 2008-03-24 08:26 x11-common
[2] ポートをリスンしている不要なサービスを止めます。以下の例では、まず、「portmap」を停止し、 システムの起動時に自動的に立ち上がらないようにしています。
debian@dlp:~$
Active Internet connections (only servers)
Proto
Recv-Q
  Send-Q
Local Address
Foreign Address
State

tcp
0
  0
0.0.0.0:53062
0.0.0.0:*
LISTEN

tcp
0
  0
0.0.0.0:111
0.0.0.0:*
LISTEN

tcp
0
  0
0.0.0.0:113
0.0.0.0:*
LISTEN

tcp
0
  0
127.0.0.1:25
0.0.0.0:*
LISTEN

udp
0
  0
0.0.0.0:32768
0.0.0.0:*
 

udp
0
  0
0.0.0.0:68
0.0.0.0:*
 

udp
0
  0
0.0.0.0:746
0.0.0.0:*
 

udp
0
  0
0.0.0.0:111
0.0.0.0:*
 

Active UNIX domain sockets (only servers)
Proto
RefCnt
  Flags
Type
State
  I-Node
PID/Program name

unix
2
  [ ACC ]
STREAM
LISTENING
  8044
2615/acpid


debian@dlp:~$
sudo /etc/init.d/portmap stop

Stopping portmap daemon....
debian@dlp:~$
sudo update-rc.d -f portmap remove
 
# 自動起動設定削除

  Removing any system startup links for /etc/init.d/portmap ...
    /etc/rc0.d/S32portmap
    /etc/rc1.d/K81portmap
    /etc/rc2.d/S18portmap
    /etc/rc3.d/S18portmap
    /etc/rc4.d/S18portmap
    /etc/rc5.d/S18portmap
    /etc/rc6.d/S32portmap
    /etc/rcS.d/S43portmap

# やっぱり自動起動に入れておく場合は以下のようにする

debian@dlp:~$
sudo update-rc.d portmap defaults

  Adding system startup for /etc/init.d/portmap ...
    /etc/rc0.d/K20portmap -> ../init.d/portmap
    /etc/rc1.d/K20portmap -> ../init.d/portmap
    /etc/rc6.d/K20portmap -> ../init.d/portmap
    /etc/rc2.d/S20portmap -> ../init.d/portmap
    /etc/rc3.d/S20portmap -> ../init.d/portmap
    /etc/rc4.d/S20portmap -> ../init.d/portmap
    /etc/rc5.d/S20portmap -> ../init.d/portmap
関連コンテンツ