Use of Linux telnet Command

  • 2021-08-28 21:48:56
  • OfStack

1. Introduction

telnet command is used to login remote host, is based on Telnet protocol remote login program, remote host management. Because telnet uses plaintext to send messages, its security is not good. Many Linux servers do not open telnet services, but use the safer ssh mode instead. However, there are still many other systems that may use telnet to provide remote login, so it is still necessary to understand how telnet clients are used.

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

In addition, Telnet protocol is a member of TCP/IP protocol family, which is the standard protocol of Internet remote login service and belongs to the application layer protocol. It is used to realize remote login based on TCP protocol.

2. Command format


netstat [-8EFKLacdfrx] [-X authtype] [-b hostalias] [-e escapechar] [-k realm] [-l user] [-n tracefile] [host [port]]

3. Description of options


-8 : Allow the use of 8 Bit character data, including input and output 
-a Try to log in to the remote system automatically; 
-b <hostalias> Specify the remote host name using an alias 
-c Do not read the .telnetrc Documents 
-d Start debugging mode 
-e <escapechar> Set escape characters 
-E Filter escape characters 
-f Effect and Specification of This Parameter "-F" Same parameters 
-F : Use Kerberos V5 When authenticating, add this parameter to upload the authentication data of the local host to the remote host 
-k <realm> : Use Kerberos When authenticating, add this parameter to make the remote host use the specified domain name instead of the domain name of the host to obtain the ticket 
-K Do not automatically log on to the remote host 
-l <user> Specify the user name to log on to the remote host 
-L Allow output 8 Bit character data 
-n <tracefile> Specify file record related information 
-r : Use a similar rlogin User interface of instructions 
-x Assuming that the host has a function that supports data encryption, use it 
-X <atype> Closes the specified authentication type. 

4. Common examples

(1) Log in to the host.


telnet 192.168.0.5

(2) Verify that a port on the remote server is available. For example, check whether port 22 of ssh service of 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

5. Common commands of Telnet client life


auth <argument> [...] Viewing and Managing telnet Login authentication method. argument Values available: disable , enable And status
close Close the current Telnet Connect 
display : Use  display  Command to view  Telnet  Current settings for the client 
logout : Similar to cloase Command for closing Telnet Connect or suspend. Note: Telnet Server may not support 
open <host> [-l user] [[-] port] Object to the specified host Telnet Connect 
send <arguments> : Use send Command can be sent to the Telnet The server sends a specific string. Support includes but is not limited to the following command strings: 
	abort Terminate Service Command 
	ao : Abort Output Discard the output command 
	ayt : Are you there Command 
	brk : Break Command 
	eof : Send End Of File Character 
	escape Sends the current escape character, initially a grouping character ^] . 
	ip Interrupt process command 
	synch : Execution Telnet Synchronous operation. 
quit : Exit  Telnet  Client. 
status Displays the current Telnet Connection status 

The above is the Linux telnet command of the use of the details, more information about Linux telnet command please pay attention to other related articles on this site!


Related articles: