Linux中测试端⼝的⼏个命令1.telnet
⽤法: telnet ip port
(1) telnet连接不存在的端⼝
telnet 1.1.1.18
Trying 1.1.
telnet: connect to address 1.1.1.1: Connection timed out
(2) telnet 链接存在端⼝
telnet 1.1.1.18000
Trying 1.1.
Connected to 1.1.1.1.
Escape character is '^]'.
Connection closed by foreign host.
2.wget
⽤法: wget ip:port
ssh命令指定端口(1) 不存在端⼝
wget1.1.1.1:8
--2017-01-2411:38:34-- 1.1.1.1:8/ Connecting to 1.1.1.
failed: Connection timed out. Retrying.
(2) 存在端⼝
wget1.1.1.1:8000
--2017-01-2411:39:03-- 1.1.1.1:8000/
Connecting to 1.1.1. connected.
HTTP request sent, 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>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论