debianで不要なLISTENポートを閉じたくなったら
誰がどのポートでLISTENしてるか調べて、意図していない不要なserviceは止める
netstatで調べる
-l:listening sockets, -t:tcp, -p:name of the program
# netstat -ltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 localhost:postgresql *:* LISTEN 19605/postgres tcp 0 0 localhost:smtp *:* LISTEN 25998/exim4 tcp 0 0 *:47709 *:* LISTEN 419/rpc.statd tcp 0 0 *:sunrpc *:* LISTEN 28638/rpcbind tcp 0 0 *:http *:* LISTEN 27662/nginx.conf tcp6 0 0 localhost:postgresql [::]:* LISTEN 19605/postgres tcp6 0 0 localhost:smtp [::]:* LISTEN 25998/exim4 tcp6 0 0 [::]:53129 [::]:* LISTEN 419/rpc.statd tcp6 0 0 [::]:sunrpc [::]:* LISTEN 28638/rpcbind
systemctlで止める
rpcbindとrpc.statdはNFSのためらしいので止める
rpcbindは
# systemctl disable rpcbind # systemctl stop rpcbind
rpc.statdは
# systemctl disable nfs-common # systemctl stop nfs-common
参考
debian - rpc.statd running on system not using NFS - Unix & Linux Stack Exchange
以上