CentOS下怎么退出telnet

发布网友 发布时间:2022-04-24 10:08

我来回答

1个回答

热心网友 时间:2023-09-10 00:56

在调试一个网络程序时遇到问题,服务启动了,客户端却连接不上;首先就想到了用telnet连接看看;
命令和Windows下一样,telnet IP 端口号

[plain] view plain copy
# telnet 192.168.0.107 1111
[plain] view plain copy
Trying 192.168.0.107...
telnet: connect to address 192.168.0.107: Connection timed out
连接超时了,估计是Windows防火墙的问题,我的服务是跑在Windows上的;

控制面板》系统安全》Windows防火墙》高级设置》新建入站规则;
再执行telnet命令看看,

[plain] view plain copy
Trying 192.168.1.107...
Connected to 192.168.1.107.
Escape character is '^]'.
连接成功,果然是防火墙的问题!

诶[éi],怎么回事! 退不出去了!Ctrl + c,Ctrl + z,ESC,q,quit,exit,都不行;

注意telnet连接成功后输出的信息:

[plain] view plain copy
Escape character is '^]'.
Ctrl + ]

姿势终于对了;

[plain] view plain copy
telnet> ?
Commands may be abbreviated. Commands are:

close close current connection
logout forcibly logout remote user and close the connection
display display operating parameters
mode try to enter line or character mode ('mode ?' for more)
open connect to a site
quit exit telnet
send transmit special characters ('send ?' for more)
set set operating parameters ('set ?' for more)
unset unset operating parameters ('unset ?' for more)
status print status information
toggle toggle operating parameters ('toggle ?' for more)
slc change state of special charaters ('slc ?' for more)
z suspend telnet
! invoke a subshell
environ change environment variables ('environ ?' for more)
? print help information
telnet> close
Connection closed.
输入问号然后回车,可以查看帮助;

输入close或quit然后回车,可以退出telnet;

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com