CSDN博客

img hem

linux 如何察看系统开放的端口? netstat

发表于2001/6/5 21:25:00  2135人阅读

分类: linux

 

如何察看系统开放的端口?

技巧管理员(2000-12-22 18:32)

返回〗〖转发〗

可以是用命令:netstat -lnp来察看系统当前监听的端口。其中l选项表示显示正在被监听(listen)的端口;n选项表示直接显示端口数字而不是通过察看/etc/service来转换为端口名;p选项表示列出监听的程序。例如:
netsat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:mysql                 *:*                     LISTEN
tcp        0      0 *:netbios-ssn           *:*                     LISTEN
tcp        0      0 *:swat                  *:*                     LISTEN
tcp        0      0 *:www                   *:*                     LISTEN
tcp        0      0 *:linuxconf             *:*                     LISTEN
tcp        0      0 *:finger                *:*                     LISTEN
tcp        0      0 *:login                 *:*                     LISTEN
tcp        0      0 *:shell                 *:*                     LISTEN
tcp        0      0 *:telnet                *:*                     LISTEN
tcp        0      0 *:ftp                   *:*                     LISTEN
udp        0      0 radiusd.301:netbios-dgm *:*
udp        0      0 radiusd.301h:netbios-ns *:*
udp        0      0 *:netbios-dgm           *:*
udp        0      0 *:netbios-ns            *:*
udp        0      0 *:ntalk                 *:*
udp        0      0 *:talk                  *:*
raw        0      0 *:icmp                  *:*                     7
raw        0      0 *:tcp                   *:*                     7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  0      [ ACC ]     STREAM     LISTENING     40250  /tmp/mysql.sock

netstat -ln
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:901             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:98              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:79              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:513             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:514             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
udp        0      0 192.168.2.33:138        0.0.0.0:*
udp        0      0 192.168.2.33:137        0.0.0.0:*
udp        0      0 0.0.0.0:138             0.0.0.0:*
udp        0      0 0.0.0.0:137             0.0.0.0:*
udp        0      0 0.0.0.0:518             0.0.0.0:*
udp        0      0 0.0.0.0:517             0.0.0.0:*
raw        0      0 0.0.0.0:1               0.0.0.0:*               7
raw        0      0 0.0.0.0:6               0.0.0.0:*               7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  0      [ ACC ]     STREAM     LISTENING     40250  /tmp/mysql.sock

0 0

相关博文

我的热门文章

img
取 消
img