📜  TELNET简介

📅  最后修改于: 2021-08-27 05:30:23             🧑  作者: Mango

TELNET代表TE rmina L NET工作。它是一种协议,使一台计算机可以连接到本地计算机。它用作ISO给出的虚拟终端服务的标准TCP / IP协议。启动连接的计算机称为本地计算机。连接到的计算机,即接受连接的计算机,称为远程计算机。在本地计算机和远程计算机之间建立连接时。在进行telnet操作期间,本地计算机将显示远程计算机上正在执行的操作。 Telnet以客户端/服务器原理运行。本地计算机使用telnet客户端程序,而远程计算机使用telnet服务器程序。

TELNET命令:
telnet的命令由前缀字符“命令解释为IAC”(IAC)标识,其代码为255。IAC后跟命令和选项代码。命令的基本格式如下图所示:

图– Telnet命令格式

以下是一些重要的TELNET命令

Character Decimal Binary Meaning
WILL 251 11111011 1. Offering to enable.
2. Accepting a request to enable.
WON’T 252 11111100 1. Rejecting a request to enable.
2. Offering to disable.
3. Accepting a request to disable.
DO 253 11111101` 1. Approving a request to enable.
2. Requesting to enable.
DON’T 254 11111110 1. Disapproving a request to enable.
2. Approving an offer to disable.
3. Requesting to disable.

以下是telnet使用的一些常见选项

Code Option Meaning
0 Binary It interpret as 8-bit binary transmission.
1 Echo It will echo the data that received on one side to the other side.
3 Suppress go ahead It will suppress go ahead signal after data.
5 Status It will request for the status of TELNET.
6 Timing mark It define the timing marks.
8 Line width It specifies the line width.
9 Page size It specifies the number of lines in a page.
24 Terminal type It set the terminal type.
32 Terminal speed It set the terminal speed.
34 Line mode It will change to the line mode.

操作方式:

大多数telnet实施均以以下三种模式之一运行:

Default mode
Character mode
Line mode

默认模式:

  • 如果没有其他模式被调用,则使用该模式。
  • 客户端在此模式下执行回显。
  • 在这种模式下,用户键入一个字符,客户端在屏幕上回显该字符,但直到整行完成后才发送。

字符模式:

  • 客户端将以这种模式键入的每个字符发送到服务器。
  • 处于这种模式的服务器通常会回显字符,以显示在客户端的屏幕上。

线路模式:

  • 行编辑(例如回显,字符擦除等)是从客户端进行的。
  • 客户端会将整行发送到服务器。