Telnet commands. To disconnect the Telnet client from the remote computer. To connect a Telnet client to a remote computer

Telnet is a network utility that allows you to connect to a remote port of any computer and establish an interactive communication channel, for example, to send commands or receive information. You could say that this is universal browser in a terminal that can work with many network protocols.

This utility was very often used to remotely control a Linux computer, but then it was replaced by the secure SSH protocol. But telnet is still used, for example, for network testing, port checking, and also for communicating with various IoT devices and routers. In this article we will look at what telnet is, as well as how to use telnet to solve your problems.

What is Telnet?

As I said, this utility is designed to create an interactive connection between remote computers. It works using the TELNET protocol, but this protocol is supported by many services, so it can be used to manage them. The protocol is based on TCP, and allows you to send regular string commands to another device. It can be used not only for manual control but also for interaction between processes.

To work with this protocol we will use the telnet utility, it is very easy to use. Let's look at the telnet syntax:

$ telnet options host port

The host is the domain of the remote computer to connect to, and the port is the port on that computer. Now let's look at the main options:

  • -4 – force the use of ipv4 addresses;
  • -6 – force the use of ipv6 addresses;
  • -8 – use 8-bit encoding, for example, Unicode;
  • -E– disable support for Escape sequences;
  • -a– automatic login, takes username from environment variable USER;
  • -b– use a local socket;
  • -d– enable debugging mode;
  • -R– rlogin emulation mode;
  • -e– set the beginning character of the Escape sequence;
  • -l– user for authorization on the remote machine.

That's it for the telnet command to establish a connection. But connecting to a remote host is only half the battle. After establishing a connection, telnet can operate in two modes:

  • Line by line- This is the preferred mode, here the line of text is edited on the local computer and sent only when it is completely ready. Not all services always have this opportunity;
  • Character-by-character– all characters you type are sent to a remote server. It will be difficult to correct anything here if you make a mistake, because Backspace will also be sent as a symbol and a movement arrow too.

The use of telnet is to send special commands. Each service has its own commands, but the protocol has its own telnet commands that can be used in the telnet console.

  • CLOSE– close the connection to the server;
  • ENCRYPT– encrypt all transmitted data;
  • LOGOUT– exit and close the connection;
  • MODE– switch the mode, from lowercase to character or from character to lowercase;
  • STATUS– view connection status;
  • SEND– send one of the telnet special characters;
  • SET– set the parameter value;
  • OPEN– establish a connection via telnet with a remote host;
  • DISPLAY– display the special characters used;
  • SLC– change the special characters used.

We will not consider all the commands, since you are unlikely to need them, and if you do, you can easily find them in the official documentation.

How to use telnet?

Next we will look at how to use telnet to solve your problems. Usually, the utility is already installed on most systems, but if this is not the case, then you can install telnet from the official repositories, for example, in Ubuntu:

$ sudo apt install telnet


You don't have to use telnet for this; ping is available.

2. Port check

Using telnet we can check the availability of a port on a host, and this can already be very useful. To check the telnet port run:

$telnet localhost 123 $telnet localhost 22

$telnet localhost 123

$ telnet localhost 22


In the first case, we see that no one accepts the connection, but in the second, a message about a successful connection and a greeting from the SSH server are displayed.

3. Debugging

To enable debug mode and output more detailed information while running, use the -d option while connecting:

$ sudo telnet -d localhost 22

$ sudo telnet - d localhost 22

4. Telnet console

Using the telnet console too important point in the analysis of how to use telnet. In the main mode, you can execute commands on a remote server, but if you want to address the command specifically to telnet, for example, to configure its operation, you need to use a special character to open the console, usually the utility immediately tells you what this character is, for example, it is used by default “^[“:


To activate it you need to press the combination Ctrl keys+[, then you enter the telnet prompt.

To see all available commands, you can type ?. For example, you can view the connection status:

telnet>status

telnet > status


There are other interesting possibilities here. Such things can be done on any connection using the telnet utility.

5. View the telnet site

One common way to use telnet is to test a website from the console. Yes, you won’t get a beautiful web page, but you can manually collect requests and see all the data sent by the server.

$ telnet opennet.ru 80

$telnet opennet. ru 80


Then issue the command to the web server.

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;
  • followed by 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 the operating system. Linux system. 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 mode work 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 perform remote control, you must install 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.

With the advent of computers and networks, corresponding programs also appeared for remote control of the system and for transmitting data over a distance. First of all, something like this software put inside operating system still in a standard form, which significantly alleviates the problem - no search for software for remote control is required. In order to connect to a specific computer from a distance, you can use a regular Windows console terminal, called the command line or otherwise known as cmd.

To contact a specific computer on the network remotely, you just have to take full advantage of the remote control The system has a "telnet" command. This command will provide not only information retrieval, but also control of all actions occurring in this system.

The "telnet" command is present on all Windows versions. But not on all versions Windows given the command is configured as required. For example, to use “telnet” on Windows 7, you need to make a number of simple settings to connect this module.

All that is required for the "telnet" command to be available is the presence of a network, as well as the system user's membership in the Administrators group. All settings are made through the menu items "services.msc". This service can be launched via search. When you launch it, you need to click on the “telnet” sign with the right mouse button and then select properties. In properties you can make a wide variety of settings for of this connection, as well as change the startup type of this service. "Telnet" for Windows 7 contains three launch options: manual mode, auto mode and shutdown mode.

If you access remote control using the input line, the "telnet" command has a number of additional commands, thanks to which the user determines which computer on the network will be connected to, through which port, and the user can also enter the full path to any file or view the entire directory when using the usual command.

In order to take advantage of all the promising conditions of “telnet”, before connecting to it, you should make sure that the Firewall settings are correct, since any incorrectness in terms of settings can entail a lot of other consequences. Incorrect configuration, in turn, will not make it possible to implement

Another reason why the connection may fail is errors. They can be issued in connection with any failure in the system or due to incorrect settings. The reason for the lack of connection can be determined by the error code, since each of the errors issued will contain its own number, which, in turn, will help identify the malfunction and eliminate it. If this server is intended for constant use, then it is better to configure it every time you start the computer. Similarly, you can configure the server to start manually.

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, something for which many strive to master it: the capabilities of the service, as well as a list of basic commands that allow these capabilities to be implemented 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 network protocol, but also the word TELNET (terminal network) 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 is much more convenient programs, which 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 use 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 a 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 installed special utilities 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".

The command line will reboot, and the TELNET command line will now 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 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 appears empty window or a request to enter additional data, which means 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 the parameters are not specified, then they are used local server and default port.
  2. Close- disconnection from 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.