Command line telnet does not work. Methods for connecting to remote devices using the telnet command. Software activation

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

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

As I said, this utility is designed to create an interactive connection between remote computers. It works over 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 ordinary string commands to be sent 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 take a look at the telnet syntax:

$ telnet options host port

Host is the domain of the remote computer to connect to, and port is the port on that computer. Now let's take a 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 debug mode;
  • -R- rlogin emulation mode;
  • -e- set the character of the beginning of the Escape sequence;
  • -l- user for authorization on a remote machine.

That's all 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 is the preferred mode, where the line of text is edited on the local computer and sent only when it is completely ready. Not always and not all services have such an opportunity;
  • Character by character- all characters you type are sent to the remote server. It will be difficult to fix anything here if you make a mistake, because Backspace will also be sent in the form of 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- see the status of the connection;
  • 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 used special characters;
  • SLC- change the used special characters.

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 do I 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 it is not, then you can install telnet from the official repositories, for example, in Ubuntu:

sudo apt install telnet

Now let's move on to using the utility. Initially, it was used to remotely control a computer, but since then the more secure SSH protocol was developed, it was no longer used.

1. Server availability

The utility can still be useful when checking the availability of a node, to do this, just pass it the ip address or hostname:

telnet 192.168.1.243

It is not necessary to use telnet for this, there is ping.

2. Port check

With the help of telnet, we can check the port availability on the node, and this can already be very useful. To check the telnet port run:

telnet localhost 123
$ telnet localhost 22

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

3. Debugging

To enable debug mode and display more detailed information at runtime, use the -d option while connecting:

sudo telnet -d localhost 22

4. Telnet console

Using the telnet console is also an important consideration in 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 kind of character it is, for example, it is used by default "^ [":

To activate it, you need to press the key combination Ctrl + [, then you will see the telnet prompt.

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

telnet> status

There are others here interesting opportunities... These things can be done on any connection using the telnet utility.

5. View the telnet website

One of the common ways to use telnet is to test the site from the console. Yes, you will not get a beautiful web page, but you can manually collect requests and see all the data transmitted by the server.

telnet opennet.ru 80

Then type the command to the web server:

The web server will return the entire page, as well as the headers required for the browser to render it.

6. Remote control telnet

It is strongly discouraged to use insecure telnet for remote control because all commands and passwords can be listened to by a third-party user. But sometimes, for example, for routers, telnet is still used for remote control. Everything works exactly the same as for other connections, only you need to use port 23, and telnet-server must be installed on the remote computer:

telnet localhost 23

Here you don't even need to specify the port, because the default will be 23. Next, you need to enter your username and password, and then you can execute commands on the remote system.

conclusions

In this article, we looked at examples of using telnet, as well as what this utility is, although it is no longer used for its main purpose, but it can still be useful to many users and system administrators... If you have any questions, ask in the comments!

Progress is a phenomenon that knows no stops. In the area of information technologies changes occur every day: new products appear, obsolete services are becoming a thing of the past. But there are tools that are still popular despite the emerging alternative. Telnet is a prime example. What is Telnet and how do I use it?

A bit of history: when and why did Telnet appear?

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

Terminal launch. Enabling required services

In modern operating systems of the Windows family, before starting Telnet, it is necessary to check whether this component is installed in the system. This is not difficult to do. For Windows 7, the most common operating system today, you need to follow the steps below:

  1. Select "Control Panel" or Control Panel from the "Start" menu.
  2. In the window that opens, select the "Programs" item. In the English version of the system, it will be Programs.
  3. Go to the "Turn Windows features on or off" tab. The system lists all available components. Already installed will be marked with checkboxes. This process can 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'll come back to that a little later. If the box next to the item we need is not ticked, it must be ticked.
  5. After pressing the "OK" button, the system will begin to install the necessary components for the correct operation of the protocol. This may take a while, but on modern computers, the process is unlikely to take more than a minute. Thus, the question of how to enable Telnet was solved in 5 simple steps.

Telnet Service: and Telnet Client?

Both concepts from the title have already been mentioned a little above. Like many other applications, Telnet distinguishes between a client and a server. 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 this connection is made will be the server. This can be a router, 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 an error message will appear when trying to establish a session. To check open and closed ports, you can use a special utility or a web service. The standard Telnet port is 23. If you want not only to independently connect to other computers, but also to allow administration of your PC via Telnet, then in the same snap-in of the operating system you must check the box next to the Telnet server component. The PCs and server hardware that you administer must be configured in the same way.

Telnet software

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

Telnet commands: how to figure it out?

It will not be difficult for an experienced person to install the necessary components in a matter of minutes (if they have not been installed earlier), open a Telnet session and complete all the configuration of the remote host. However, there are also newcomers who see the console for almost the first time in their life. How do I 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 by standard keys, for example, help or "?". Secondly, given how old the network is, you can find an infinite number of resources with useful information by syntax. Thus, there is absolutely nothing to worry about. And practice shows that with the help of several lines of commands, the result is much easier to achieve in most cases. And after a few sessions, you will confidently type the commands you need without calling the syntax helper.

Telnet on network devices

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

Depending on the manufacturer and specific model You can enable Telnet access in different ways. You can log into the router via the web interface or through the console. In the first case, you will need to find the remote administration point where this or that type of connection is allowed (Telnet, ssh). In the second case, access can be provided via the command line. Each administrator chooses a scenario convenient for himself. However, there are routers in which only one of the two possible options for the initial connection is implemented, 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 an item where you need to put the coveted checkbox, but in reality there is nothing complicated about it. The interface of most modern routers is fairly self-explanatory. The names of the menu items speak for themselves, the minimalist design will not let you get confused.

Benefits of Telnet sessions

At this point, we've gotten enough familiarity 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 at all.

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

Compared to other remote administration protocols, Telnet is less CPU intensive. With the current pace of development, this plus may seem insignificant, but only at first glance. Along with the development of technology, software companies do not stand still. Applications are becoming more and more cumbersome, require more hard disk space, more random access memory, more powerful processors... A utility that, against the background of the rest of the 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 via an unencrypted communication channel. The only obstacle for an attacker is user authentication at the moment of opening a Telnet session, that is, the requirement for a username and password. However, this data is also transmitted unencrypted. Therefore, if someone sets out to hack Telnet access, they just need to briefly run a packet sniffer (software for "catching" packets). After some time, the administrator will open his Telnet session and tell the remote server the 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 on broadly accessible networks, for example, outside your secure local office network. Also, be aware that the connection to the server may be interrupted.

Conclusion. Should I use it or not?

Of course, other methods of remote administration have emerged in 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, it is still used. If you follow certain safety principles, remembering that your the local network must be reliably protected from outside penetration, using Telnet will not harm your equipment. With negligence about security, SSH or any other technology will not save you.

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

Few computer users today are aware of the existence of various special protocols on a computer that allow performing various actions without using a graphical interface and third-party programs. Therefore, the desire to know how to use the TELNET service immediately arises when they learn about the corresponding protocol.

Next, a little theory will be presented about what TELNET is, what many seek to master it for: the capabilities of the service, as well as a list of basic commands that allows these capabilities to be implemented on Windows.

TELNET is a means of communication 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 only a network protocol, but also the word TELNET (terminalnetwork) 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 textual interface that differs from the graphical one familiar to an ordinary 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. 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 be done with the help of Telnet even now.

Network connections

With Telnet you can:

  • connect to remote computers;
  • check the port for access;
  • use applications that are available only 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 in use today, and derive some benefit from this;
  • provide other users with access to data located on their computer.

We start using

Running

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

  • Go to the Control Panel.

  • Select the "Programs" item.
  • Select the "Turn Windows features on or off" tab.

  • Find a Telnet client and put a marker in front of it, if it is not already installed.

Then we press "OK" and wait a minute while the client is installed.

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

  1. Run the command line as administrator.
  2. We enter "telnet".

The command line restarts, and now the TELNET command line will open, in which we will work.

Checking the port

One of the simplest things TELNET does is check the port. You can check the port to see if it can be accessed from your computer. To do this, you need to do the following:

V command line, opened by the method above, we 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 we enter:

telnet 192.168.0.1 21

If the command gives an error message, then the port is not available. If a blank window appears or if you are asked to enter additional data, then the port is open. For Windows, this method of checking the port can be quite convenient.

Commands

TELNET commands form 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 other various actions. As mentioned above, on Windows, they are entered at the command line of the Telnet application.

In order 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, then local server and the default port.
  2. Close- disconnecting from a remote server. The parameters are similar.
  3. Set- setting of the remote server, used with the name of the managed server. Together with Set the following commands are used:
    1. - is used to specify a terminal of the specified type.
    2. - specifies a control character.
    3. - sets the operating mode.
  4. Unset [parameter]- disables the previously set 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. All you need to do is learn the syntax and list of commands and start practicing. You can learn a lot, and at the same time start looking at the Internet and at the usual actions on the Internet in a completely different way.

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 Telnet service is present. 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 this type of connection. Telnet is not any software, it is communication protocol... But it should be noted that there are some utilities that work through the "terminalnetwork" protocol.

In the recent past, Telnet was one of the main ways to connect to the network. Now utility practically not used... Today, more advanced protocols are installed in operating systems, excluding 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 catalogs that can only be opened using this type of protocol;
  • dispatch Email without using additional software;
  • users using this protocol allows other users get 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 launch instructions:

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

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

Port check

Checking a network port for access to it personal computer in Telnet:

  • in the window you must enter the telnetip command;
  • followed by to introduceIP address computer, for example 192.168.1.1. You can view the address in the settings of the network router;
  • at the end we 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 not available or asking for additional information if the port is open.

Telnet Commands

Utility commands are a way to interact with it. To display list of all teams, you must enter "help". Next, let's take a closer look at the main commands:

  • "Open" - the request allows connect to a remote server;
  • "Close" - process interruption connections to a remote server;
  • "Set" - customization server connection parameters;
  • "Term" - the request is intended for terminal type indication;
  • "Escape" - sets control character;
  • "Mode" - selection operating mode;
  • "Unset" - discharge previously entered parameters;
  • "Start" - launch server;
  • "Pause" - temporary stop server operation;
  • "Continue" - continuation of work server after a pause;
  • "Stop" - full termination of work server.

Telnet on Linux

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

Let's consider the main modes of operation:

  • « line by line". This operating mode is recommended. In this case, the request is edited on the local PC and is sent to the server only when it is ready;
  • « character by character". Each character typed in the console window is sent to the remote server. Text editing cannot be done here. When you delete a character using "Backspace", it will also be sent to the server.

Basic Linux commands:

  • "Close" - interruption of the connection;
  • "Encrypt" - enable encryption;
  • "Logout" - turn off the utility and close the connection;
  • "Mode" - selection of the operating mode;
  • "Status" - connection status;
  • "Send" - sending a telnet request;
  • "Set" - setting the 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, check access to the port by entering the request "telnet localhost 122" and "telnet localhost 21". A message will appear on the console screen whether the connection is accepting any of the ports;
  • example of remote control via 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 that, a message will appear asking you to enter your username and password.

Disadvantages of Telnet

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