Telnet Server

Configure Telnet Server In RHEL-6


Telnet server is used to login into another system. You can use the telnet command to log in remotely to another system on your network. The system can be on your local area network or available through an Internet connection. 

Telnet was developed in 1969. Telnet was initially developed for private use where security was not primary concern. Telnet protocol has serious security issue. Security expert recommend that the use of Telnet for remote login should be discontinued under all normal circumstances.
  • Telnet Server
  • Telnet Client

Telnet Sever

Telnet server software is installed on remote host. You need to configure it before client can connect with it.

Telnet Client

Telnet client software allows you to connect telnet server. Once telnet client establishes a connection to the remote host, client becomes a virtual terminal, allowing you to communicate with the remote host from your computer.
Note-
  • In RHEL Telnet is part of the xinetd daemon.
  • Telnet use plain text to transmit password.
  • root user is not allowed to connect using Telnet.
  • Command-line telnet clients are built into all major operating systems.
  • RedHat recommends you to use SSH to connect a system instead of Telnet.
  • Use Telnet in LAB environment where security is not concern.
Configure Telnet.. 

Server PC-
Step-1 Set Static IP-
[root@server ]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
---------------------------------------------------------------
DEVICE="eth0"
IPADDR=192.168.0.1
NETMASK=255.255.255.0
HWADDR="00:16:D4:39:5B:6F"
NM_CONTROLLED="yes"
ONBOOT="yes"
DNS1=192.168.0.1
----------------------------------------------------------------

Step-2 Install Packages

[root@server ]# yum install telnet* -y
[root@server ]# yum install xinetd -y

Step-3 Configure '/etc/xinetd.d/telnet' file..

[root@server ]# vim /etc/xinetd.d/telnet
----------------------------------------------------------------------------------------------------------------
 default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{

        disable        = no
        flags            = REUSE
        socket_type = stream
        wait             = no
        user             = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
}

:wq!
----------------------------------------------------------------------------------------------------------------

Step-4 Restart Services...

[root@server ]# /etc/init.d/xinetd restart;chkconfig xinetd on
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                            [  OK  ]
 
[root@server ]# chkconfig xinetd --list
xinetd             0:off    1:off    2:on    3:on    4:on    5:on    6:off
 
[root@server ]#

Step-5 Disable Firewall-

[root@server ]# system-config-firewall

Click Disable--->Click Apply--->Yes
Step-6 Create User..
Note- As I said above root user is not allowed to login from telnet. We need to create a normal user account.
[root@server ]# useradd user-1 
[root@server ]# passwd user-1
Changing password for user user-1.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
 
[root@server ]#
 
Client-side

Step-1 Set Static IP-
[root@client ]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
---------------------------------------------------------------
DEVICE="eth0"
IPADDR=192.168.0.2
NETMASK=255.255.255.0
HWADDR="01:16:D4:49:5B:7F"
NM_CONTROLLED="yes"
ONBOOT="yes"
DNS1=192.168.0.1
----------------------------------------------------------------

[root@client ]# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=1.07 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.235 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.175 ms

Step-2 Install Package

[root@client ]# yum install telnet* -y

[root@client ]# rpm -qa telnet
telnet-0.17-47.el6_3.1.i686

Step-3 Connetct Telnet User..

[root@client ]# telnet 192.168.0.1          (Server IP)
Trying 10.0.2.182...
Connected to 10.0.2.182.
Escape character is '^]'.
Red Hat Enterprise Linux Server Release 6.1 (Santiago)
Kernel 2.6.32-431.11.2 .el6.i686 on an i686
login: user-1
Password:
[user-1@server ]$                           
This time we have successfully connected with Telnet user-1.  

How to Configure Telnet Client on Windows

Step-1 Open Command Prompt and Check Ping..
C:\Users\ashu>ping  192.168.0.1

------------------------------------------------------------------------------
Pinging 192.168.0.1 with 1450 bytes of data: 
Reply from 192.168.0.1: bytes=1450 time<10ms TTL=32 
Reply from 192.168.0.1: bytes=1450 time<10ms TTL=32 
Ping statistics for 192.168.0.1: 
        Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), 
Approximate roundtrip times in milliseconds: 
        Minimum = 0ms, Maximum = 10ms, Average = 2ms


------------------------------------------------------------------------------

Step-2 Turn on Telnet Client Service...

Click Stsrt Button----> Open Control Panel---> Click on Program--> click on turn windows features on or off----> Scroll down and check mark on Telnet client and click on OK

Step-3 Now you can run telnet command. Login form normal user...

C:\Users\ashu>telnet 192.168.0.1                               (Telnet Server IP)
Red Hat Enterprise Linux Server Release 6.1 (Santiago)
Kernel 2.6.32-431.11.2 .el6.i686 on an i686
login: user-1
Password:
[user-1@server ]$ 

This time we have successfully connected with Telnet user-1.  

How to access root user through telnet-
Note- By default root user is not allowed to login through the terminal session
Step-1 Go to Server System, open '/etc/securetty' file and edit last line... 

[root@server ]# vim /etc/securetty 
--------------------------------------------------------------------------
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
pts/8

 t
:wq! (Save & Quit)
--------------------------------------------------------------------------

Now Go back on window client system and try again to login from root user..
C:\Users\ashu>telnet 192.168.0.1                               (Telnet Server IP)
Red Hat Enterprise Linux Server Release 6.1 (Santiago)
Kernel 2.6.32-431.11.2 .el6.i686 on an i686
login: root
Password:
[root@server ]#

This time we have successfully connected with Telnet server.

No comments:

Post a Comment