使用 telnet
测试端口连接
-
安装
telnet
(如果尚未安装):sudo apt update sudo apt install telnet
-
使用
telnet
测试端口:
假设你要测试example.com
的80
端口(HTTP),可以运行以下命令:telnet example.com 80
如果连接成功,你会看到类似以下的输出:
Trying 93.184.216.34... Connected to example.com. Escape character is '^]'.
如果连接失败,你会看到类似以下的输出:
Trying 93.184.216.34... telnet: Unable to connect to remote host: Connection refused