Methods for connecting to remote devices using the telnet command. Basic telnet commands and features of the remote access utility Telnet command line

💖 Do you like it? Share the link with your friends

Application layer protocol TELNET (from English. T.E. rmina LNET work) is a network protocol for implementing a text interface over the network. Name telnet We also received client programs for implementing this protocol for almost all existing operating systems. The Telnet protocol is one of the oldest network protocols, developed as a means of communication between remote terminals in test mode. Therefore, it does not provide data encryption or modern authentication tools. The protocol is vulnerable to many network attacks and cannot be used as a means of managing network operating systems. Currently, for remote access The system uses the SSH (Secure SHell) network protocol, the creation of which focused specifically on security issues. The relative security of Telnet sessions is carried out only in a fully controlled network environment or using protection at the network level (various implementations of VPN - virtual private networks). However, TELNET is still used to manage specialized network devices (Switches, routers, etc.), as well as for network diagnostics, debugging and studying other text-oriented (telnet-like) protocols based on the TCP transport. The current Telnet protocol standard is described in RFC 854.

In modern operating systems of the Windows family, the utility telnet.exe by default, not installed. To install it you need to go to Control Panel - Programs and Features - Turn it on or off Windows components and check the box for Telnet client. Or, in a command prompt running as an administrator, run the command:

pkgmgr /iu:"TelnetClient"

Command line format:

telnet [-a][-e Symbol][-f File][-l Name][-t Type][Host [Port]]

Command line options:

-l The user name to log into the remote system, assuming the TELNET ENVIRON option is supported.

-a Automatic login attempt. Like the -l switch, but uses the current username under which you are logged in.

-e Service character for switching input mode in the telnet client window.

-f Client-side log file name. In the Russian help, this parameter is incorrectly interpreted as Login_File - “File name on the client side for logging into the system.”

-t Telnet terminal type. 4 types of terminals are supported: vt100, vt52, ansi and vtnt.

Knot Hostname or IP address remote computer to which you are connecting. Port Port number or service name. If the number is not specified, then the standard Telnet port 23\TCP is used

When launched without parameters, the utility goes into command input mode:

Welcome to the Microsoft Telnet Client

Microsoft Telnet>

When entering a character ? or help Help information is displayed:

Teams may be shortened. Supported commands are:

c-close- close the current connection

d-display- display operation parameters

o - open hostname [Port]- connect to the site (by default, Port = 23)

q - quit- exit telnet

set-set- set parameters ("set?" to display a list of them)

sen - send- send strings to the server

st - status- display information about the current state

u - unset- reset parameters ("unset ?" to display a list of them)

? /h - help- issue a certificate

Some of the commands allow you to get hints for use when entered with a question character:

Telnet> set ?- get a hint on using the mode setting command. Example of information displayed:

bsasdel- symbol BackSpace Delete

crlf- carriage return mode; causes CR & LF characters to be sent

delasbs- symbol Delete will be sent as a character BackSpace

escape x- where x is the symbol for switching to telnet terminal mode and back

localecho- enable local echo.

logfile x- where x is the log file. In Russian translation it is incorrectly interpreted as “Current client login file”

logging- recording the current session in the log. In Russian translation it is incorrectly interpreted as "executing a login"

mode x- where x=console is the console mode used to work with windowed applications (vi editor) and x=stream is the streaming mode used to work on the command line.

ntlm- enable NTLM authentication.

term x- type of emulated terminal. Where x is ansi, vt100, vt52, or vtnt.

For tips on canceling set parameters the command is used

Microsoft Telnet> unset?

bsasdel- symbol BackSpace will be sent as a character Delete

crlf- line feed mode; causes the CR character to be sent

delasbs- symbol Delete will be sent as a character Backspace

escape- the symbol for switching to telnet terminal mode and back is not set

localecho- disable local echo

logging- disable log recording. In the Russian-language version it is incorrectly interpreted as "disabling login"

ntlm- disable NTLM authentication.

Examples of commands in interactive mode:

open 192.168.0.1- connect to the Telnet server with an IP address 192.168.0.1

o zte-f660- connect to a Telnet server named zte-f660. Command abbreviation used o pen

set logfile C:\telnet.log- use as log file C:\telnet.log

set logging- record the current session to a log file.

display- display the parameters of the current session. Example of information displayed:

Mode switch symbol: "CTRL+]"

NTLM Authentication - Enabled

Local echo output - disabled

Mode new line- Symbol ENTER will be shipped as CR & LF

Current mode: Streaming

TERMINAL MODE

Preferred ANSI Terminal Type

    In practice, the utility telnet.exe used as a diagnostic and debugging tool to connect not only to the Telnet server on TCP port 23, but also to any other TCP port, thereby allowing interaction with any command line-controlled application. So, for example, using the utility telnet you can connect to servers that support text (telnet-like) input of commands and data - SMTP, POP3, IMAP, etc. In addition, the utility can be used as a means of roughly checking the connectivity to any TCP port (checking whether a specific TCP port is listening).

telnet 192.168.1.1 8080- connect to host 192.168.1.1 on port 8080. In cases where the port is closed, the utility will report that connection is impossible. Moreover, to check the availability of a certain port, it is not even necessary that it is listened to by a service that supports text input, such as a VNC server. To disconnect from the remote server, you must enter the mode switching symbol (by default - CTRL+]).

The telnet.exe utility can be used, for example, to communicate with mail server according to the protocol POP3(Post Office Protocol ver. 3). This protocol is used by email client programs (Outlook, Outlook Express, The Bat etc.) to receive email, stored in mailbox user. This is the simplest protocol based on the exchange text messages. In order to study the interaction mail client with a mail server, you can implement a connection session using TELNET.

By default, the POP3 server listens for incoming connections via TCP protocol to port 110 ("listens" to port tcp/110). Telnet command to connect to a server, for example pop.mail.ru

telnet pop.mail.ru 110

If the server is healthy, its invitation will appear in the telnet window

+OK mPOP POP3 v1.1

user [email protected]

After which, the server will prompt you to enter a password:

OK Password required for user [email protected]

You need to enter a password

pass VasinPass

The server will report the result of the password check:

You can request a list of letters with a directive list:

list

In response to this, the server will display a list and sizes of letters in the mailbox:

OK 10 messages (152527 octets)
1 48628       1 is the serial number, 48628 is the size
2 1829
3 2070
:

If necessary, you can view the headers of the letters. To do this, use the command top sequence number, space, number of lines from the message body

top 2 0

In response to this, you will see the header of the letter containing service information about the sender, date of sending, return address and some other data:

Received: from (HELO mx1.ks.pochta.ru) by node7-1.ks.pochta.ru with QIP.RU LMTP
for [email protected];
Fri, 08 Apr 2011 15:18:33 +0400
Received: from mx3.softkey.ru ()
: :

The directive is used to receive letters retr sequence number

retr 2 - receive a letter with sequence number 2

To delete a letter, use the directive dele sequence number For example, to remove the 2nd letter from the list received by the directive list:

If the deletion was successful, the server will display the following message:

OK message 2 deleted

Sometimes, the TELNET command can also be used to identify the service listening on the specified port, since many of them display either their banner or specific service information when connected. For example, the FTP server greeting: 220-FileZilla Server version 0.9.43 beta

220-written by Tim Kosse ( [email protected])

220 Please visit http://sourceforge.net/projects/filezilla/

And this is what the screen looks like when connecting to the RealVNC server:

RFB 003.008

Progress is a phenomenon that knows no stops. In the area information technology changes occur every day: new products appear, outdated services become a thing of the past. But there are tools that are still popular despite the emergence of alternatives. A prime example is the Telnet protocol. What is Telnet and how to use it?

A little history: when and why did Telnet appear?

Telnet appeared more than 40 years ago, shortly after the installation of the first ARPANET server. This is one of the oldest protocols on the Internet. In an era when there was no trace of it, but the first networks had already appeared, the need for remote connection to devices dictated its requirements. The first solution to the problem that appeared, like all subsequent ones, allowed you to work on a remote device as if it were your own. All supported functionality has become available in the interface. You just need to get the required access level and know the Telnet commands. We figured out what this protocol is and why we need it. But how is Telnet connection implemented today?

Launch the terminal. Enable required services

In modern operating systems of the Windows family, before starting Telnet, you need to check whether this component is installed on the system. This is not difficult to do. For Windows 7, the most common operating system today, you need to perform the following sequence of actions:

  1. Select "Control Panel" or Control Panel from the Start menu.
  2. In the window that opens, select “Programs”. In the English version of the system this will be Programs.
  3. Go to the “Turn Windows features on or off” tab. The system generates a list of all available components. Already installed ones will be marked with checkboxes. This process may take several minutes.
  4. After the list is loaded, you need to find the Telnet client item. There is also a Telnet server in the menu, but we will return to this a little later. If there is no checkmark next to the item we need, it needs to be checked.
  5. After clicking the "OK" button, the system will begin to install the necessary components for the correct operation of the protocol. This may take some time, but modern computers the process is unlikely to take more than a minute. Thus, the question of how to enable Telnet was resolved in 5 simple steps.

Telnet service: and Telnet client?

Both concepts from the title have already been mentioned a little higher. Like many other applications, Telnet has a client side and a server side. However, a Telnet server is not necessarily a server in the general sense of the word. The computer from which the connection is made is considered to be a client, the device to which the connection is made this connection, will be the server. This could be a router, a computer, or any other host that supports command line control. If we are talking about remote administration of a personal user computer or server, the Telnet port must be open. It is often closed for security reasons, so when you try to establish a session, an error message will appear. To check open and closed ports, you can use a special utility or web service. The standard Telnet port is 23. If you want to not only connect to other computers yourself, but also allow administration of your PC via Telnet, then in the same operating system snap-in you need to check the box next to the Telnet server component. The PCs and server hardware that you administer should be configured in the same way.

Programs for working with Telnet

After starting all the necessary Telnet services, you can safely start working using the built-in Windows tool - the command line. It is called up from the Start menu, either by clicking on the corresponding item, or by speed dialing (cmd). It is advisable to always run the command line with “Administrator” user rights (either local, the device on which you are working, or domain). This way, you won't have to restart the application if elevation is required. In addition to the existing tool of the operating system itself, there are also third-party programs that allow access via the Telnet protocol. The most popular of them is Putty. Along with it, other applications running under different operating systems are also popular, such as TeraTerm, AnyConnect, DTelnet, EasyTerm, KoalaTerm and many others. Which program to use, everyone decides for themselves, depending on personal preferences, interface requirements, etc. There are no significant differences in terms of functionality between them, and there cannot be. Each utility implements the entire available list of Telnet commands.

Telnet commands: how to figure it out?

For an experienced user, it will not be difficult to install the necessary components in a matter of minutes (if they have not been installed previously), open a Telnet session and perform all the configuration of the remote host. However, there are also newcomers who see the console almost for the first time in their lives. How to find out the list of available commands in Telnet? What is WONT AUTH or SET LOCALECHO? Everything is not as difficult as it seems at first. First, you should always remember that any command interface has built-in help. It can be accessed using standard keys, for example, help or “?”. Secondly, given how old the Internet is, you can find an endless number of resources with useful information by syntax. Thus, there is absolutely nothing to worry about. And practice shows that using several lines of commands the result is much easier to achieve in most cases. And after just a few sessions, you will confidently type the necessary commands without resorting to the syntax assistant.

Telnet on network devices

We have already said that using the Telnet protocol you can manage not only computers, but also a wide variety of network devices. The most common class of such devices is routers. So what is Telnet in a router, what is it for, how to enable it?

Depending on the manufacturer and specific model There are different ways to enable Telnet access. You can log into the router via the web interface or through the console. In the first case, you will need to find the item remote administration, where one or another type of connection is allowed (Telnet, ssh). In the second case, access can be granted via the command line. Each administrator chooses a scenario that is convenient for themselves. However, there are routers that implement only one of the two possible options During the initial connection, for example, only the web interface is available. An administrator who is accustomed to working with the console will find it rather uncomfortable to look for the item where he needs to put the coveted checkbox, but in reality there is nothing complicated about it. The interface of most modern routers is quite clear. The names of the menu items speak for themselves; the minimalist design will not allow you to get confused.

Advantages of Telnet sessions

At this point, we've become familiar enough with the technology to talk about the pros and cons of Telnet. No matter how successful the product is, it cannot be said that it is absolutely devoid of disadvantages. And if we are talking about a service that was released at the very beginning of the 70s of the last century, you should not forget about this fact.

Of the obvious advantages, it is necessary to note the simplicity, speed and convenience of the protocol. In less than a minute, a convenient client will contact the server TCP port of your choice and create a local terminal emulation. Above we talked about the standard 23 working port. In fact, you can “listen” and “talk” via Telnet on any port. This is where the flexibility of the protocol lies.

Compared to other remote administration protocols, Telnet is less processor intensive. With the current pace of development, this plus may seem insignificant, but only at first glance. Along with the development of technology, companies producing software do not stand still. Applications are becoming more and more bulky, requiring more and more space on the hard drive, more RAM, more powerful processors. A utility that, compared to other installed software, will consume a small amount of system resources will come in handy.

Disadvantages of the Telnet protocol

The main and often cited disadvantage of Telnet is that access to a remote device is carried out over an unencrypted communication channel. The only barrier for an attacker is user authentication at the time of opening a Telnet session, that is, the requirement for a login and password. However, this data is also transmitted unencrypted. Therefore, if someone sets out to hack Telnet access, he only needs to briefly run a packet sniffer (software for “catching” packets). After some time, the administrator will open his Telnet session and provide the remote server with his login and password, which will be immediately intercepted by the attacker in clear text. In this context, an alternative to Telnet is SSH (secure connection). Therefore, it is not recommended to use Telnet in widely accessible networks, for example, outside your secure office LAN. In addition, you should remember that the connection to the server may be interrupted.

Conclusion. To use or not?

Of course, other methods of remote administration have emerged over more than four decades. SSH is very popular. It would seem that Telnet should have disappeared a long time ago. But it is still in demand and is still used. If you follow certain safety principles, keeping in mind that your local network must be reliably protected from outside penetration; using Telnet will not cause harm to your equipment. If you neglect security, neither SSH nor any other technology will save you.

Telnet is still used in areas such as connecting to databases, checking the availability of network devices (routers and switches), server equipment, etc.

Not all computer users are aware of the presence of hidden services that allow you to perform various operations without using special software. In operating rooms Windows systems and Linux there is a Telnet service. This material will discuss in detail the purpose of the service, commands, capabilities and how to work with it correctly.

What is Telnet

Telnet is a means of communication that is established between terminal devices. An example of such a connection is quite simple: a personal computer and a server that supports a similar type of connection. Telnet is not any software, it is communication protocol. But it should be noted that there are some utilities that work via the “terminalnetwork” protocol.

In the recent past, Telnet was one of the main ways to connect to the network. Now the utility practically not used. Today, operating systems have more advanced protocols installed, eliminating any additional actions from the user.

This communication protocol is used in some operations:

  • connection to a remote desktop;
  • examination ports for connectivity;
  • usage software that is only available on remote machines;
  • application system directories, which can only be opened using this type of protocol;
  • sending email without using additional software;
  • users using this protocol allows other users gain access to your personal computer.

Installation and launch

There is no need to download the utility; Telnet is built into Windows 7/8/10 by default.

Installation and startup instructions:

In order to start the client you need to open the command line:

We invite you to watch the video on installing Telnet in Windows:

Port check

Checking a network port to see if it can be accessed personal computer to Telnet:

  • in the window you need to enter the telnetip command;
  • what follows enterIP address computer, for example, 192.168.1.1. You can view the address in the settings of your network router;
  • At the end, enter the FTP port “21”. Thus the command will look like this: telnet 192.168.0.1 21;
  • after that it will appear error message if the port is unavailable or asking you to enter additional data if the port is open.

Telnet Commands

Utility commands are a way to interact with it. To display list of all commands, you must enter “help”. Next, we will look at the main commands in detail:

  • “open” - the request allows connect to a remote server;
  • "close" - process interruption connecting to a remote server;
  • "set" - setting server connection parameters;
  • "term" - the request is intended for terminal type indications;
  • "escape" - sets control character;
  • "mode" - choice operating mode;
  • "unset" - reset previously entered parameters;
  • "start" - launch servers;
  • "pause" - temporary stop server operation;
  • "continue" - continuation of work servers after a pause;
  • "stop" - complete work stoppage server.

Telnet on Linux

Like Windows, Telnet is built into operating system Linux. Previously it was used as the standard Telnet protocol, now it has been replaced by the more improved SSH. As with the previous OS, the utility in Linux is used to check ports, routers, etc.

Let's look at the main operating modes:

  • « line by line" This operating mode is recommended. In this case, editing the request is carried out on the local PC and is sent to the server only when it is ready;
  • « character-by-character" Every character typed in the console window is sent to the remote server. You cannot edit the text here. When you delete a character using “Backspace”, it will also be sent to the server.

Basic commands in Linux:

  • “close” — interrupt the connection;
  • “encrypt” — enable encryption;
  • “logout”—turn off the utility and close the connection;
  • “mode” — selection of operating mode;
  • “status” — connection status;
  • “send” — sending a telnet request;
  • “set” — setting server parameters;
  • “open” — connection to a remote server;
  • “display” — display of special characters.
  • in the console window enter a request for server availability checks, for example, "telnet 192.168.1.243";
  • Next, let’s check access to the port by entering the request “telnet localhost 122” and “telnet localhost 21”. A message will appear on the console screen indicating whether any of the ports are accepting the connection;
  • example of remote control using telnet. To do this, enter the request “telnet localhost 23” in the main window. "23" is the default port. To produce remote control, must be installed on local computer"telnet-server". After this, a message will appear asking you to enter your login and password.

Disadvantages of Telnet

The main disadvantage of this protocol is the remote connection without using encryption. The only security point is the authorization of users in the telnet session. But nevertheless, the login and password are also transmitted in unencrypted form, so access to them can be obtained one way or another. It is strongly recommended not to transmit any important data over local networks.

Few computer users today are aware of the existence of various special protocols on the computer that allow GUI And third party programs perform various actions. Therefore, the desire to learn how to use the TELNET service immediately arises when they learn about the corresponding protocol.

Next, we will outline a little theory about what TELNET is, what many people strive to master it for: the capabilities of the service, as well as a list of basic commands that allows you to implement these capabilities on Windows.

TELNET is a communication tool that establishes a transport connection between terminal devices, clients, that is, your computer and someone else’s machine, a server that supports this connection standard. This is not a special program, but just a network protocol, but the word TELNET (terminal network) also refers to various utilities that also use this protocol. Today Telnet is present almost everywhere, all operating systems, one way or another, use it, in

TELNET implements a text interface, which differs from the graphical interface familiar to the average user in that all commands must be entered manually.

What does all this give us?

Previously, this service was one of the few ways to connect to the network, but over time it has lost its relevance. Today there are much more convenient programs that do all the work for the user, and do not force him to memorize various commands in order to perform the simplest actions. However, some things can still be done using Telnet.

Network connections

With Telnet you can:

  • connect to remote computers;
  • check the port for access;
  • use applications that are only available on remote machines;
  • use various directories that can only be accessed in this way;
  • send emails without using special programs(clients);
  • understand the essence of the work of many protocols used today, and derive certain benefits from this;
  • provide other users with access to data located on their computer.

Let's start using it

Launch

Launching TELNET on Windows 7 and any other Windows is quite simple. To do this, you first need the client, if it is not already installed:

  • Go to the Control Panel.

  • Select “Programs”.
  • Select the “Turn Windows features on or off” tab.

  • Find the Telnet client and put a marker next to it if it is not already installed.

Then click “OK” and wait a minute while the client is installed.

The terminal is launched in Windows via the command line, if you do not have any special utilities installed for working with Telnet. But since you are reading this article, it means that you are just starting to get acquainted with this topic, and first it would be nice to master the basics of management using the command line.

  1. Launch the command line as administrator.
  2. Enter "telnet".

Command line reboots, and now the TELNET command line will open, in which we will work.

Checking the port

One of the simplest actions performed in TELNET is port checking. You can check the port to see if it can be accessed from your computer. To do this you need to do the following:

In the command line opened using the method above, enter: telnetip address port number

For example, if your IP address is 192.168.0.1 and the port number is 21 (FTP port), then enter:

telnet 192.168.0.1 21

If the command produces an error message, it means the port is unavailable. If a blank window appears or a request to enter additional data, then the port is open. For Windows, this method of checking the port can be quite convenient.

Teams

TELNET commands are the basis for using the terminal. With their help, you can control a computer that uses this protocol, if access is allowed for you, as well as perform various other actions. As mentioned above, on Windows they are entered in the command line of the Telnet application.

To see the main list of commands, enter in the line help and press "Enter". Basic commands:

  1. Open- connection to a remote server. You must enter this command along with the managed server name and port number, for example: openredmond 44. If parameters are not specified, the default local server and port are used.
  2. Close- disconnect from a remote server. Similar parameters are used.
  3. Set- setting up a remote server, used with the name of the managed server. Together with Set The following commands are used:
    1. - used to specify a terminal of the specified type.
    2. - sets the control character.
    3. - sets the operating mode.
  4. Unset [option]- disables a previously specified parameter.
  5. Start- starts the Telnet server.
  6. Pause- pauses the server.
  7. Continue- resumes work.
  8. Stop- stops the server.

TELNET is one of the oldest protocols, but it is still used today. This means that you can start using it for your own purposes. To do this, you just need to learn the syntax and list of commands and start practicing. You can learn a lot of new things, and at the same time begin to look at the Internet and your previously familiar online activities in a completely different way.

Tell friends