
netstat
Ubuntu Server에서 다음을 표시하는 데 사용할 정확한 명령이 무엇인지 아는 사람이 있습니까 ?
- 서버에서 수신 대기하는 포트
- 해당 포트에 대한 현재 TCP 연결
답변1
노력하다
netstat --tcp --listen --numeric-ports
전.
$ netstat --tcp --listen --numeric-ports
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 ::1:6010 :::* LISTEN
그리고
netstat --tcp --numeric-ports
전.
$ netstat --tcp --numeric-ports
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 272 192.168.1.11:22 192.168.1.3:43444 ESTABLISHED
tcp 0 0 192.168.1.11:22 192.168.1.2:65370 ESTABLISHED
tcp 0 0 192.168.1.11:22 192.168.1.2:65369 ESTABLISHED