How to set up telnet in AWS instance?
Asked Answered
P

2

29

I got SSH working fine. But I am facing an issue with connecting via telnet.

Outbound

Inbound

Putty

Pithy answered 20/5, 2017 at 12:28 Comment(12)
does ` telnet <you ip address> 22 ` give the same result?Debrief
It is giving result like.. Escape character is '^]'. SSH-2.0-OpenSSH_6.6.1Pithy
Connection closed by foreign hostPithy
is telnet service installed , ` sudo yum -y install telnet-server `. By default it is not installed.Debrief
I have installed telnet by "yum install telnet"Pithy
Now i am getting message like "Protocol mismatch", in 22 portPithy
From 23 port "telnet:connect to address XX.XX.XX.xX : connection time outPithy
Can you connect via telnet from the host itself? (in SSH session)Felonious
I tried connect from another connection.. it is not connectingPithy
You need to install telnet-server , telnet is the client packageDebrief
Yes i installed.. By using this command only sudo yum -y install telnet-serverPithy
Can you try the steps mentioned in aws-certification.blogspot.in/2016/01/…Debrief
D
14

ssh is recommended over telnet, as telnet is not encrypted and is by default not installed in amazon instance.

However if needed, steps involved for Linux : Amazon Instance or Centos

  1. Install telnet daemon in the instance: Install telnet-server using sudo yum install telnet-server . Package telnet is for the client program in case one want to connect using telnet client from the instance, not needed for the exercise.

  2. Enable the telnet daemon service: - By default the service is disabled in /etc/xinetd.d/telnet, The disable flag needs to be set to no.

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

    Post change it should look like below service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID disable = no }

    Verify the configuration in case of any edit related errors. sudo chkconfig xinetd on

  3. Bring up the telnet service:

    Bring up the telnet daemon as root using sudo service xinetd restart command

  4. Enable inbound telnet default port (23) on AWS Console: In AWS Console EC2/Security Groups/<Your Security Group>/Inbound, set a rule

    Type:Custom-TCP Rule

    Protocol: TCP Range

    Port Range: 23

    Source: <As per your business requirement>

  5. Test the telnet connection: Test the telnet connection from any client enabled in the firewall.

    >telnet ec2-XX-XX-XXX-XXX.region.compute.amazonaws.com. Connected to ec2-XX-XX-XXX-XXX.region.compute.amazonaws.com. Escape character is '^]'. Password:

The steps(tools) will vary slightly for other linux variants.

PS: Referred http://aws-certification.blogspot.in/2016/01/install-and-setup-telnet-on-ec2-amazon.html, fixed few issues in the commands.

Debrief answered 20/5, 2017 at 17:14 Comment(0)
R
54
 sudo yum -y install telnet

This works for me after logging in to the EC2 instance

Rooks answered 30/9, 2019 at 19:12 Comment(1)
This works for adding telnet to an EC2 Linux 2 AMI. Note, this does not set up a telnet server/service. OP may have wanted the latter, but I wanted the former (simple telnet to another host to check if a remote port is listening).Busywork
D
14

ssh is recommended over telnet, as telnet is not encrypted and is by default not installed in amazon instance.

However if needed, steps involved for Linux : Amazon Instance or Centos

  1. Install telnet daemon in the instance: Install telnet-server using sudo yum install telnet-server . Package telnet is for the client program in case one want to connect using telnet client from the instance, not needed for the exercise.

  2. Enable the telnet daemon service: - By default the service is disabled in /etc/xinetd.d/telnet, The disable flag needs to be set to no.

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

    Post change it should look like below service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID disable = no }

    Verify the configuration in case of any edit related errors. sudo chkconfig xinetd on

  3. Bring up the telnet service:

    Bring up the telnet daemon as root using sudo service xinetd restart command

  4. Enable inbound telnet default port (23) on AWS Console: In AWS Console EC2/Security Groups/<Your Security Group>/Inbound, set a rule

    Type:Custom-TCP Rule

    Protocol: TCP Range

    Port Range: 23

    Source: <As per your business requirement>

  5. Test the telnet connection: Test the telnet connection from any client enabled in the firewall.

    >telnet ec2-XX-XX-XXX-XXX.region.compute.amazonaws.com. Connected to ec2-XX-XX-XXX-XXX.region.compute.amazonaws.com. Escape character is '^]'. Password:

The steps(tools) will vary slightly for other linux variants.

PS: Referred http://aws-certification.blogspot.in/2016/01/install-and-setup-telnet-on-ec2-amazon.html, fixed few issues in the commands.

Debrief answered 20/5, 2017 at 17:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.