Linux의 특정 포트에서 netstat를 사용하는 방법 포트가 netstat를 사용하여 서버를 실행하고 있는지 알고

내 특정 포트가 netstat를 사용하여 서버를 실행하고 있는지 알고 싶습니다. 어떻게하면 되나요?



답변

당신이 사용할 수있는

netstat -pnlt | grep ':portno'

다른 옵션은 서버에서 열린 포트를 확인하기 위해 nmap 도구를 사용할 수 있습니다

nmap -sT -O localhost

산출

Starting nmap 3.55 ( http://www.insecure.org/nmap/ ) at 2004-09-24 13:49 EDT
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1653 ports scanned but not shown below are in state: closed)
PORT      STATE SERVICE
22/tcp    open  ssh
25/tcp    open  smtp
111/tcp   open  rpcbind
Device type: general purpose

Netstat 예 :

[root@krizna ~]# netstat -pnlt | grep ':80'
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 :::80                       :::*                        LISTEN      1164/httpd

답변

사용하다 netstat -anp | grep portNumber


답변

netstat -nat | grep port | grep LISTEN트릭을해야 한다고 생각 합니다.