How to run telnet command on command line. TELNET—Basics of Use

Few computer users today know about the existence of various special protocols on the computer that allow them to perform various actions without using a graphical interface or third-party programs. 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 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 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 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 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".

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 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.

Telnet can be used as a command in the Windows operating system. In fact, this is not only an executable service, but also a network protocol or even firmware, which, using a text field, allows the user to “communicate” with a remote computer, sending the system a command to perform a particular action, as well as receiving a log of its execution.

The name of the protocol stands for Terminal network, which literally means terminal network.

What is Terminal network

Using the telnet command, despite its low functionality, you can perform quite a lot of tasks, such as:

  • checking the connection to the server using an open port;
  • connection to remote devices (modem, router or switch) to send a command (reboot, shutdown or receive logs);
  • updating the firmware of network equipment or mobile phone;
  • file transfer.

Many people believe that such a connection works, like most network services, on a client-server principle. However, it is not. telnet is a completely two-way service with the same functionality and access levels.

Interestingly, the program itself includes a minimal set of functions, which contains only a connection option and an authentication process (verifying the authenticity of the username and password that is allowed access). All other options, both command and system, are called by the connected applications.

How to work with the shell?

To use the telnet command's functionality, you must use the command line. In the seventh version of Windows and higher, the service is disabled by default and does not start automatically when the command is called. Therefore, you need to follow these steps to enable telnet:


How to manage the service?

Once you enter the Windows Terminal Management service, you need to know a few commands to be able to manage it. There are the following options for obtaining a list of control keys:


If you are familiar with the options, you can immediately connect to the desired resource with the required data. In this case, the server for the connection is “smatp.ya.ru” and the port is “25”.

Result:

The telnet command is very easy to use and quite convenient. However, the technology of its operation does not provide for safety at all. The shell runs under Windows in a completely unprotected mode and without encryption. Therefore, instead of this function, ssh has been used for quite some time.

According to the principle of organizing the connection, they are almost the same. But the ssh protocol was developed taking into account possible security technologies. In some cases, a simpler connection method is quite sufficient, for example, when you need to connect to equipment to load new firmware into it or restore the old one, as well as to change the system configuration.

If you use several protocols to connect at once, then it is faster, more convenient and safer to do this through a special program, for example “Putty”.

Using the telnet command makes it possible to establish a communication channel with computers at a distance.

And the utility itself is almost a kind of browser emulator in the terminal, supporting several network protocols.

Previously, telnet was often used to manage PCs running the Linux operating system.

And now, using the same utility, they test the network, check ports, manage routers and other IoT devices.

Content:

Features of the utility

Despite the fact that the main task of telnet is to create a connection between PCs remote from each other using the protocol of the same name, you can also manage other services using the utility.

For example, access POP3, HTTP, IRC or SMTP.

After all, these and some other services operate on the basis of the TCP transport protocol, to work with which you can use the telnet client.

The syntax of telnet commands when connecting to a remote computer is as follows: $ telnet (options) (host) (port).

The host is the domain of the computer to which the connection is made. Port – port on the computer from which access is being made. And the options could be as follows:

  • -4 and -6 enforce the use of ipv4 and ipv6 addresses, respectively;
  • -8 makes it possible to use 8-bit encoding;
  • -E disables support for escape sequences;
  • -a automatically registers the user on the remote system;
  • -d enables debugging mode;
  • -p enables rlogin emulation;
  • -e sets the initial escape character;
  • -l authorizes the user in the system.

After a connection to the remote host is established, the telnet utility begins working in one of two modes - line by line or character by character.

The first option is the most preferable due to the ability to edit the text directly and send it only after the user has completely typed in all the information.

The disadvantage of this line-by-line mode is the lack of support for it by some services. While character-by-character can be used in any case.

However, when using it, all information is sent instantly.

And if the user makes a mistake, it will be impossible to correct it - after all, even spaces and Backspace are sent to the server in the form of characters.

You should know: When using the telnet protocol, there is no possibility of encrypting information transfer. All data is sent directly and can be intercepted by an unauthorized user. And it is not recommended to transmit them in this way - it is advisable to use the secure Secure Shell network protocol for this.

Basic Commands

When working with the telnet protocol, the user enters the appropriate commands into the console. The most popular include the following:

  • OPEN (PC name) (port). Allows you to communicate with the computer whose name is specified in the command. If you do not specify a port, the utility will try to use the default number. Sometimes it is indicated instead of the PC name;
  • DISPLAY (argument). Command to display a full or partial set of telnet utility parameters;
  • CLOSE. Designed to close the telnet session and return the system to command mode;
  • QUIT. Command to end all open connections and exit telnet;

Rice. 2. Using the Quit command in the MS Telnet client.

  • MODE TYPE. Used to control one of two input mode options (character-by-character or line-by-line). In this case, a request is sent to the remote computer to switch to a certain mode, and, if it is supported by the service, the corresponding switching is provided;
  • STATUS. A command that displays the current utility status, name and exchange mode;
  • ? (team). Reports information about the corresponding command sequence. It is needed in cases where the user is going to use a command that is unfamiliar to him;
  • ! (team). Executes a command sequence on the local system;
  • SEND ARGUMENTS. Sends character arguments to the remote PC;
  • ESCAPE. Sends one of the escape characters such as comma, bracket, or caret (^);
  • SYNCH. Serves to send a synch sequence that allows you to cancel all commands typed but not yet sent. Used only in line-by-line mode;
  • BRK. Sending a break sequence when the Break key is pressed.

All of these commands are basic, although their total number is much larger. However, due to the rather rare use of this utility, the easiest way to find a complete list of them is by entering HELP in the terminal.

And, after displaying the complete list, get help information about each command sequence using the “?” command.

Although, for example, for a telnet client on Windows, the list may be shortened.

17.12.2016 Frank 0 Comments

Have you come across the term Telnet? Maybe you've heard jokes about it or how others have used it.

For those who do not know what Telnet is and its “relevance” in the modern Internet, read the entry below.

Learn something about its history and what the security implications of its use are.

Also get acquainted with some modern types of its practical applications.

What is the Telnet protocol

Telnet is a text-based network protocol that is used to access remote computers using TCP/IP.

It was created and launched in 1969 - you could say it was the first Internet.

In the old days, you had to actually specify the server location to access the data.

This meant that, among other things, it was necessary to spend time arriving at his location, and then wait to work with the server.

Even if the server hardware could execute many commands at once, you couldn't use it—you had to wait for others to finish their work.

In many cases, you couldn't even touch the server itself. Your application had to be given to the employee and then returned to pick up the required information after it was typed on paper.

Today Telnet has brought many important changes. Now it is possible for several users to connect to the server simultaneously.

To connect to the server, you need a terminal, which can be the simplest and cheapest computer.

This computer does not need powerful hardware, you only need a network connection and a text interface.

What is Telnet Server in Windows 7 – Windows 10

In the Windows 7 – Windows 10 operating system, you can add two functions:

  • Telnet server - If you install this feature, you can configure your computer to act as a server. This means that your computer will be configured to accept incoming connections and allow others to use it. If you have your firewall disabled and have a public IP address, then anyone in the world can control your computer remotely using a Telnet client.
  • Telnet Client - This will allow you to connect via Telnet from any server using only a command window.

Telnet Security

Although Telnet has changed a lot since its inception, the technology still has weaknesses.

The worst thing is with security. It transmits and receives data in text mode without using encryption.

This means that when connecting to the server, personal data such as account username and password will be sent in plain text.

Anyone who knows how to use network connection tracking will be able to see all the data being transferred.

In short, anyone attempting to use Telnet for serious matters such as transferring valuable information to manage servers or services will be at great risk.

When this protocol was invented, high-speed internet connections were not available, there were very few hackers, malware, etc.

In the beginning, it was used by institutions that were closed online and provided controlled access to their servers. At that time, encryption was not high on the list of essentials.

Today, Telnet is the most insecure protocol you can use to transmit information and data.

Why use Telnet

Now that you know a little about the history of Telnet and that it is a very insecure protocol, but despite all this, people still use it - why.

  • Older servers still use this protocol for remote connections. There are still a few old UNIX servers out there somewhere, and there are still people Telneting to access them.
  • Some network devices such as Cisco routers allow Telnet to connect to them. In them you can configure the use of the client.
  • The main reason why people still use it is to look up text, play games, check the weather forecast and much more.
  • Some people still use Telnet CPC to manage and connect to information systems and text discussions. For example, on forums there is nothing but text. You don't even need images or graphics. Therefore, there are still many active communities online.

I hope you have gained a basic understanding of Telnet - this protocol is something of a dinosaur in the modern world, which has changed radically since its birth.

The Telnet protocol is a standard for data exchange between two network devices, designed to implement remote control. Not everyone knows that setting up a Wi-Fi router can be done via Telnet from any computer on the local network. To do this, it is necessary that the Telnet access option is enabled in the router, and it must be enabled via the web interface.

An interesting fact is that sometimes you can log into the router using Telnet, while access via HTTP, that is, through the graphical interface, remains unavailable.

Condition for being able to connect to the router

If you want to go to the router management interface, you first need to find out what the IP address of this device is. Without an IP address, you won’t even be able to open a Telnet session, let alone access it through a browser. Most network harvesters have the following address by default: 192.168.1.1. For D-Link, you need to make a correction in the last two digits (should be “0.1”). Configure your PC's network card to the appropriate values ​​by changing the last digit of its IP.

Setting up a connection on a computer

How to open a communication session

Every operating system has a command line. Once you launch it, you just need to run one command: telnet 192.168.1.1. After which the router, connected to the PC via Ethernet or Wi-Fi, immediately responds to us, asking for a login and password.

Starting a communication session

In our response, we used the name “admin” and password “1234”, that is, the default values ​​​​in ZyXEL devices. As you can see, these values ​​were accepted and the “config” prompt appeared.

Some ZyXEL models use not only a text interface, but also a command list (menu):

Start list view

To return to text command mode, go to 28 -> 4 (use step 28 and then step 4). As a result, you will receive the inscription “config” and a cursor for entering commands. In what follows, we will consider only this mode.

Configuring the device via Telnet

The text command interface, that is, the command line of routers and other ZyXEL devices, is called the word “CLI” (Command Line Interpreter). Most of the commands for all models are the same, for example, “system reboot” (reboot), “system config-save” (save settings), and others. Some commands for a particular model may differ, but you can download a detailed manual on the support website, where they provide proprietary firmware for download.

Download the directory with commands

Devices from companies other than ZyXEL provide a “help” command, which gives you a list of available commands.

Remote access to the web interface

The WAN port of the network harvester is assigned an IP address. The value of this address usually does not change, even if dynamic addresses are used. Knowing his IP address, the user can open the device management interface from any computer with an Internet connection. By default, this access method is prohibited in ZyXEL routers. And the command line will help you get rid of this limitation.

Type the following command: ip static tcp ISP 80 192.168.1.1 80 // port “80” is used by the web interface.

The “ip static” command actually creates a binding of local addresses to global IP addresses. Note that if you are using a type of connection where authorization is provided (PPTP, L2TP or PPPoE), then instead of the word “ISP” you must substitute another name. It’s easy to find out: Interface ?// all network interfaces will be displayed.

For the PPPoE protocol, the Internet connection interface is usually named “PPPoE0” (case is important). Don't forget to save the settings (system config-save). As a result, it will be possible to open the web interface from the Internet.

The interface opened from the “external”

Some providers block port 80, so it probably won’t work the first time. But you can do it more cunningly by redirecting external port number 8080 to internal port 80: ip static tcp ISP 8080 192.168.1.1 80 // this way we bypass the provider’s restrictions.

In general, the port for Telnet is forwarded in a similar way (its number is “23”).

A sea of ​​commands for Wi-Fi

The easiest way to start mastering the command line is to use those commands that are responsible for the parameters of the access point (Wi-Fi network). Each of these commands begins with the word “interface”, and then there is a qualifying sequence. The simplest option: interface ssid SYSDAY // the name of the wireless network will be set to “SYSDAY”.

Note that by specifying the “auto” parameter instead of the name, you can return the “access point” to the SSID value that was set at the factory.

There are several more interesting commands that control the radio module. To avoid typing the word “interface” every time, use it as a separate command (the prompt is transformed into “config-if”). We provide a list of commands used in the “config-if” mode below.

Examples of commands for Wi-Fi

  • power number // instead of the word “number”, set the power as a percentage;
  • channel number // instead of “number”, specify the radio channel number (1-13);
  • country-code country // the “country” parameter contains 2 letters, for example, RU;
  • hide-ssid // hide network name;
  • no hide-ssid // open network name.

And this is not a complete list of parameters that can be changed directly from the command line.

It should be noted that using Telnet you can change or enable the Wi-Fi encryption algorithm (WPA or WPA2).

And the key value is set by the “interface authentication wpa-psk” command. Thus, it becomes possible to log into the router remotely, from anywhere in the world, via Telnet and change the password for the wireless network. Very useful, isn't it?

Telnet to the router-modem