How do you create a instance that allows telnet?

0

I am trying to create a instance that I can telnet into, with a client, and telnet back out of to another location.

I have tried different types of instances, to no avail.

Can anyone help me create such an instance, preferrable with step-by-step instructions?

I am getting a bit frustrated with my outdated knowledge and current computing.

Any help is appreciated.

Hijak3k
질문됨 7달 전632회 조회
4개 답변
0

These steps are for Amazon Linux, they wil be broadly the same on RHEL/CentOS/Fedora.

Install the telnet-server package on your host, and have it running and listening on the standard telnet port 23 ....

[root@ip-172-31-3-181 ~]# yum list telnet*
Last metadata expiration check: 0:02:49 ago on Wed Oct 25 21:33:08 2023.
Available Packages
telnet.x86_64                                  1:0.17-83.amzn2023.0.2                            amazonlinux
telnet-server.x86_64                           1:0.17-83.amzn2023.0.2                            amazonlinux
[root@ip-172-31-3-181 ~]# yum install -y telnet-server
Last metadata expiration check: 0:03:00 ago on Wed Oct 25 21:33:08 2023.
Dependencies resolved.
============================================================================================================
 Package                  Architecture      Version                            Repository              Size
============================================================================================================
Installing:
 telnet-server            x86_64            1:0.17-83.amzn2023.0.2             amazonlinux             38 k
.
.
.
Installed:
  telnet-server-1:0.17-83.amzn2023.0.2.x86_64                                                               

Complete!
[root@ip-172-31-3-181 ~]# systemctl status telnet.socket
○ telnet.socket - Telnet Server Activation Socket
     Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:telnetd(8)
     Listen: [::]:23 (Stream)
   Accepted: 0; Connected: 0;
[root@ip-172-31-3-181 ~]# systemctl enable telnet.socket
Created symlink /etc/systemd/system/sockets.target.wants/telnet.socket → /usr/lib/systemd/system/telnet.socket.
[root@ip-172-31-3-181 ~]# systemctl start telnet.socket
[root@ip-172-31-3-181 ~]# 

Open port 23 in the security group that is associated with your instance (and, not relevant in this example, if you have a host-based firewall like iptables or firewalld then open port 23 in that as well).

Now you should be able to telnet to the instance:

$ telnet
telnet> o [public_ip_of_ec2]
Trying [public_ip_of_ec2]...
Connected to [public_ip_of_ec2].
Escape character is '^]'.

Kernel 6.1.56-82.125.amzn2023.x86_64 on an x86_64 (1)
ip-172-31-3-181 login:

To telnet from this host onto somewhere else, the client package needs to be installed:

[root@ip-172-31-3-181 ~]# yum install -y telnet
Last metadata expiration check: 0:12:32 ago on Wed Oct 25 21:33:08 2023.
Dependencies resolved.
============================================================================================================
 Package             Architecture        Version                             Repository                Size
============================================================================================================
Installing:
 telnet              x86_64              1:0.17-83.amzn2023.0.2              amazonlinux               64 k
.
.
.
Installed:
  telnet-1:0.17-83.amzn2023.0.2.x86_64                                                                      

Complete!
[root@ip-172-31-3-181 ~]# 
profile picture
전문가
Steve_M
답변함 7달 전
  • [ec2-user@ip-172-31-33-223 ~]$ systemctl enable telnet.socket Failed to enable unit: Access denied

  • Run it as root, or prefix the command with sudo

0

Hello.

Are the required port numbers allowed in the inbound rules of the EC2 instance's security group?
For example, if you are listening on port 80, you will need to allow port 80 in your security group's inbound rules.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#adding-security-group-rule

profile picture
전문가
답변함 7달 전
0

Hey, I think you are looking for SSH instead of Telnet. Please have a look at this doc for step by step details on how to connect to an EC2 instance via SSH: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-ssh.html

AWS
Steve T
답변함 7달 전
0

While these answers are inclusive, they are not what I asked for. These are examples of what I DON'T need.

I am trying to create an instance that I can telnet INTO via a telnet ONLY client, and telnet OUT to another location.

I can create the instance to allow me to connect via telnet. However it asks for no login credentials to allow me access via the telnet client I am using to be able to telnet back out using said client.

Hijak3k
답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠