List Of Telnet Command and Examples – POFTUT

List Of Telnet Command and Examples


telnet is very important protocol used to connect remote systems via command line. It has some security defects but used widely because of its simple and widespread usage. In this tutorial we will learn telnet commands.

Install Telnet From Windows Command Line

We have all ready examined how to install telnet in Windows operating systems. This can be looked from following tutorial.

How To Install and Use Telnet Client In Linux and Windows

In this case we will use  dism tool from command line. This will also require Administrator privileges.

> Dism /Online /Enable-feature /FeatureName:TelnetClient
Install Telnet From Windows Command Line
Install Telnet From Windows Command Line

Install Telnet For Ubuntu, Debian, Mint, Kali

We can install telnet client with the following command for Ubuntu, Debian, Mint, Kali.

$ sudo apt install telnet

Install Telnet For Fedora, CentOS, RedHat

We can install telnet client with the following command for Fedora, CentOS, RedHat .

$ sudo yum install telnet

Connect Remote Telnet Server

We can connect a remote telnet service with the telnet command like below. We just need to specify the remote system IP address or host name. In this example we will connect 192.168.142.138 .

$ telnet 192.168.142.138
Connect Remote Telnet Server
Connect Remote Telnet Server

We will also provide the user name and password.

Connect Remote Telnet Server with Different Port Number

Default telnet port is TCP/23. But in some cases we can change port number for security reasons. If so we need to specify the port number explicitly. We will add the port number after the IP address or host name. In this example we will connect remote telnet port 2323 .

$ telnet poftut.com 2323

Start Telnet Interactive Shell

Now we start using telnet interactive shell. Interactive shell provides some commands specially created for telnet. We can start a telnet interactive shell with telnet command like below.

$ telnet
Start Telnet Interactive Shell
Start Telnet Interactive Shell

Help Command

In order to list all commands provided by telnet interactive shell and their explanation we can use h or help command like below.

> h

OR

> help
Help Command
Help Command

As we can see that command short and long usage with explanation.

LEARN MORE  Linux Tmux Tutorial With Examples

Open Command

We can use open command in order to connect remote system. We can also use o short usage form by providing the remote system IP address or host name.

> o 192.168.142.138

Close Command

We can use close command in in order to close current connection to the remote system.

> close

Display Command

Telnet provides terminal functions. Terminals provides some features which can be displayed with the display command.

> display
Display Command
Display Command
  • We can see that Escape Character is `CTRL+ü`
  • `NTLM` authentication enabled
  • Local echo is off
  • New line mode is CR & LF
  • Current mode is console
  • Preferred termina type is ANSI

Quit Command

If we want to exit from the current telnet interactive shell we can use quit command. Alternative is q command.

> quit
Quit Command
Quit Command

Set Command

We can enable given terminal settings with set command. We can list avaiable settings with set ?

> set ?
Set Command
Set Command

Unset Command

unset is used to disable given terminal option which is the reverse of set command.

> unset ntlm

Status Command

status command will list current connection status. We can list current status with s command too. In this example we can see that there is no connection.

> status
Status Command
Status Command

Leave a Comment