0

linux 怎样查看端口是否开放或者被占用

hermosa created at5 years ago view count: 2346
report
回复
0
sudo netstat -anp | grep :80
5 years ago 回复
0
lsof -i :80
5 years ago 回复
0

上面都只能在服务器上面查看下面的方法可以在远程或者本地查询都OK,

 nc -vz baidu.com 80
 nc -vz 127.0.0.1 80

输出

found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
    outif en1
    src 192.168.0.122 port 59203
    dst 220.181.57.217 port 80
    rank info not available
    TCP aux info available

Connection to baidu.com port 80 [tcp/http] succeeded!

或者使用nmap,telnet

telnet baidu.com 80
nmap -p 80 baidu.com
5 years ago 回复

相关搜索关键词

Recent search keywords