What is the function of telnet in linux

08-01-2023

The content of this article mainly explains the function of telnet in Linux. Interested friends may wish to take a look. The method described in this article is simple, quick and practical. Now let the editor take you to learn what the role of telnet in linux is!

In linux, telnet is the user interface of the TELNET protocol, which is based on the Telnet The remote login program of the protocol is used to log in to the remote host, and can also determine whether a certain port of the remote server can be accessed. The syntax telnet [-8acdEfFKLrx][-b][-e][-k ][-l][-n][-S][-X][host name or IP address].

What is telnet

telnet It is a remote login program based on the Telnet protocol, which is used to log in to the remote host and manage the remote host.

The telnet command is the user interface of the TELNET protocol. It supports two modes: command mode and session mode. Although telnet supports many commands, in most cases, we just use it to check whether the target host is open A port (23 by default).

Because telnet uses clear text to transmit messages, the security is not good. Many Linux servers do not open telnet services, but switch to the more secure ssh method. But there are still many other systems that may use telnet to provide remote login, so it is still necessary to figure out how to use telnet.

The telnet command can also be used for other purposes, such as determining whether a port on a remote server is accessible.

In addition, the Telnet protocol is a member of the TCP/IP protocol family. It is a standard protocol for Internet remote login services. It belongs to the application layer protocol and realizes remote login based on the TCP protocol.

Command format

telnet [-8acdEfFKLrx][-b][-e] [-k][-l][-n][-S][-X][Host name or IP address]

Option Description

-8 allows the use of 8-bit character data , including input and output -a Attempt to automatically log in to the remote system -b Use an alias to specify the remote host name -c Do not read the .telnetrc file in the user-specific directory -d enable debug mode -e set escape character -E filter out escaped characters -F When using Kerberos V5 authentication, adding this parameter can upload the authentication data of the local host to the remote host -f This parameter has the same effect as the -F parameter -k When using Kerberos authentication, adding this parameter allows the remote host to use the specified domain name instead of the domain name of the host -K Do not automatically log in to the remote host -l specifies the user name to log in to the remote host -L Allows output of 8-bit character data -n Specifies the file to record related information -r Use a user interface similar to the rlogin command -S Set the IP TOS information required for telnet connection -x If the host has the function of supporting data encryption, use it -X Close the specified authentication form

Common examples

(1) Log in to the host. The provided port is not shown and defaults to 23.

telnet 192.168.0.5

(2) Confirm whether a certain port of the remote server is available. For example, check whether port 22 of the ssh service of the remote server is open.

telnet 10.234.178.144 22 Trying 10.234.178.144... Connected to 10.234.178.144. Escape character is '^]'. SSH-2.0-OpenSSH_6.0

The above means that port 22 of the remote server's ssh service has been opened. Note that this does not mean that using the ssh command can definitely establish an SSH link with the remote server, and authorization from the remote server is required.

(3) Enter the command line interactive mode.

If telnet is invoked without a host parameter, it will enter command mode with a prompt of telnet>.

telnet telnet>

Common subcommands in interactive mode are:

auth [...]: View and manage telnet login authentication methods. Possible values ​​of argument: disable, enable and status close: close the current Telnet connection display: Use the display command to view the current settings of the Telnet client logout: Similar to the close command, it is used to close or hang up the Telnet connection. Note: Telnet server may not support open [-l user] [[-] port]: establish a Telnet connection to the specified host send : Use the send command to send specific strings to the Telnet server. Support includes but is not limited to the following command strings: abort: Terminate service command ao: Abort Output, give up the output command ayt: Are you there command brk: Break command eof: Send End Of File character escape: Send the current escape character, initially the grouping character ^]. ip: interrupt process command synch: Perform Telnet synchronization operation. quit: Quit the Telnet client. status: Display the current Telnet connection status

At this point, I believe that everyone has a deeper understanding of the role of telnet in Linux, so let's do it in practice! This is the Yisu Cloud website. For more related content, you can enter the relevant channels for inquiries, follow us, and continue to learn!

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us