2015-07-21 39 views
1

當我檢查我的服務器,我發現了一些奇怪的端口:網絡端口打開,但沒有連接進程?

[[email protected] ~]# netstat -tulnp |grep "-" 
Proto Recv-Q Send-Q Local Address Foreign Address State  PID/Program name 
tcp  0  0 0.0.0.0:2049  0.0.0.0:*   LISTEN  -     
tcp  0  0 0.0.0.0:33181 0.0.0.0:*   LISTEN  -     
udp  0  0 0.0.0.0:2049  0.0.0.0:*      -     
udp  0  0 0.0.0.0:33252 0.0.0.0:*      - 

沒有程序可以在netstat -tulnp(with root privilege)輸出被發現。

我怎麼才能找到這些端口的用法?我怎麼能判斷它是安全的?

OS:CentOS的5.6 x86_64的

內核:2.6.18-238.el5#1 SMP週四年01月13 15點51分15秒EST 2011 x86_64的x86_64的x86_64的GNU/Linux的

更新:

# rpcinfo -p 
program vers proto port 
100000 2 tcp 111 portmapper 
100000 2 udp 111 portmapper 
100011 1 udp 824 rquotad 
100011 2 udp 824 rquotad 
100011 1 tcp 827 rquotad 
100011 2 tcp 827 rquotad 
100003 2 udp 2049 nfs 
100003 3 udp 2049 nfs 
100003 4 udp 2049 nfs 
100021 1 udp 33252 nlockmgr 
100021 3 udp 33252 nlockmgr 
100021 4 udp 33252 nlockmgr 
100003 2 tcp 2049 nfs 
100003 3 tcp 2049 nfs 
100003 4 tcp 2049 nfs 
100021 1 tcp 33181 nlockmgr 
100021 3 tcp 33181 nlockmgr 
100021 4 tcp 33181 nlockmgr 
100005 1 udp 839 mountd 
100005 1 tcp 842 mountd 
100005 2 udp 839 mountd 
100005 2 tcp 842 mountd 
100005 3 udp 839 mountd 
100005 3 tcp 842 mountd 
+0

沒有'lsof'輸出 –

+0

試試'lsof -n -i | grep -i 2049' – chengpohi

回答

1

這些很可能是由portmapper保留的RPC端口。 2049是一個衆所周知的NFS使用的端口。您的其他端口可能是其他RPC服務。要查詢portmapper以獲取完整的服務及其端口列表,請使用rpcinfo -p

+0

謝謝@安迪布朗。正如我在上面顯示'rpcinfo -p'所示的那樣,不需要擔心,對吧? –

+0

如果你不需要NFS,那麼它應該[禁用](http://www.cyberciti.biz/faq/centos-redhat-rhel-fedora-remove-nfs-services/)。如果您確實需要它,請確保您已經保護它或使用安全的替代方法,例如sshfs的。 –

相關問題