Close

linux – telnet

telnet comes in 2 parts,

 

- telnet (client)

- telnet-server (daemon, that will by default listen on port 23)

 

How to Install Telnet in CentOS / RHEL / Scientific Linux 6.4

 

Telnet is also really useful to check if a certain port on a remote machine is open, here's the format:

$ telnet {ip number} {port number}

For example, to check port 22, we do:

telnet 192.168.52.201 22
Trying 192.168.52.201...
Connected to home-directories.
Escape character is '^]'.
SSH-2.0-OpenSSH_6.6.1

This shows port 22 is open, whereas if we check a port that is closed, e.g. in my case 21, then we get:

[root@openldap-client01 ~]# telnet 192.168.52.201 21
Trying 192.168.52.201...
telnet: connect to address 192.168.52.201: Connection refused

 

also install nmap:

 

yum install nmap

 

after that you can check if telnet daemon is listenning on the correct port:

[bash][root@puppetagent1 ~]# nmap localhost

Starting Nmap 5.51 ( http://nmap.org ) at 2014-08-04 02:08 BST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000019s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 995 closed ports
PORT       STATE SERVICE
22/tcp   open   ssh
23/tcp   open   telnet
25/tcp   open   smtp
111/tcp open   rpcbind
631/tcp open   ipp [/bash]