2011/05/06(金)Debian で標準起動する rpc サービスを止める 

Debian6で稼働中のサーバに、iptables で通過設定してあるホストから nmap でポートスキャンをかけたらこんなことに。

# nmap -sT xxx.example.com

Starting Nmap 5.00 ( http://nmap.org ) at 2011-05-06 18:04 JST
Interesting ports on xxx.example.com (44.111.2.333):
Not shown: 991 closed ports
PORT    STATE    SERVICE
22/tcp  open     ssh
25/tcp  open     smtp
53/tcp  open     domain
80/tcp  open     http
110/tcp open     pop3
111/tcp open     rpcbind
587/tcp open     submission
995/tcp open     pop3s

rpcサービスがなぜか標準で起動している……。nfsなんて使わないので不要なサービスを止めたい。

ただ最近の Debian は起動設定まわりがいろいろ変更されて、chkconfigとかではうまく止まらないことがあるのでパッケージごと消すことにしました。

# apt-get remove portmap nfs-common

最近のdebianでは

# apt-get remove rpcbind nfs-common

メモ

特定のポートを使用中のプロセスを調べる。

# lsof -i:111
# netstat -ap

特定のファイルを含むパッケージを調べる。

$ dpkg -S [filename]