首页 > 系统服务 > 详细

Linux中测试端口的几个命令

时间:2019-10-22 19:39:42      阅读:86      评论:0      收藏:0      [点我收藏+]

https://blog.csdn.net/z1134145881/article/details/54706711

1.telnet

用法: telnet ip port
(1) telnet连接不存在的端口  
telnet 1.1.1.1 8
    Trying 1.1.1.1...
    telnet: connect to address 1.1.1.1: Connection timed out
(2) telnet 链接存在端口
telnet 1.1.1.1 8000
    Trying 1.1.1.1...
    Connected to 1.1.1.1.
    Escape character is ^].
    Connection closed by foreign host.

 

 

2.wget

用法: wget ip:port
(1) 不存在端口
 wget 1.1.1.1:8  
    --2017-01-24 11:38:34-- http://1.1.1.1:8/   Connecting to 1.1.1.1:8... 
    failed: Connection timed out. Retrying.

(2) 存在端口
 wget 1.1.1.1:8000
    --2017-01-24 11:39:03--  http://1.1.1.1:8000/
    Connecting to 1.1.1.1:8000... connected.
    HTTP request sent, awaiting response... 200 OK

 

3.ssh

用法: ssh -v -p port username@ip
-v 调试模式(会打印日志).
-p 指定端口

 

 

4.

用法: curl ip:port
(1) 不存在端口
    获取不到结果
(2) 存在端口
    curl  1.1.1.1:8000
    <!DOCTYPE html>
    <html>
        <head>xxx</head>
        <body>
            ......
        </body>
    </html>

 

Linux中测试端口的几个命令

原文:https://www.cnblogs.com/whutao/p/11721944.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!