Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

CentOS 下 telnet 連上後退不出來的解法

有 CentOS 使用者在除錯網路程式時遇到狀況:服務已啟動,用戶端卻連不上,用 telnet 測完發現是 Windows 防火牆的問題;但 telnet 連線成功後,卻怎麼樣都退不出來。這該怎麼辦?

CentOS 下 telnet 連上後退不出來的解法

一開始試了 Ctrl+C、Ctrl+Z、ESC、q、quit、exit 全都沒用。

關鍵線索其實藏在連線成功後的那行訊息:

Escape character is '^]'.

也就是要先按 Ctrl + ] 才能回到 telnet 自己的命令模式。

接著輸入问号並 Enter 可看到說明:

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 後 Enter 就能離開。記住這個「Ctrl + ] 再下指令」的順序,以後就不會被卡住了。

Copyright © Linux教程網 All Rights Reserved