> telnet [host] [port] # 检测指定端口是否通畅。
> telnet baidu.com 80
Trying 123.125.114.144...
Connected to baidu.com (123.125.114.144). # 出现Connected表示连通了,说明百度的80端口开放的
Escape character is '^]'. # 按键ctrl+]退出此地。
^]
telnet> quit
Connection closed.
# 如果写脚本通过telnet检查端口可以用下面的方法:
> echo -e "\n"|telnet baidu.com 80|grep Connected
Connection closed by foreign host.
Connected to baidu.com (123.125.114.144).
Linux - 检测远程端口是否打开
最新推荐文章于 2024-05-13 19:41:05 发布