如何在AWS实例中设置telnet? [英] How to set up telnet in AWS instance?
问题描述
我的SSH工作正常.但是我在通过telnet连接时遇到了问题.
I got SSH working fine. But I am facing an issue with connecting via telnet.
推荐答案
ssh ,因为 telnet 未加密且默认情况下未安装在Amazon实例中.
ssh is recommended over telnet, as telnet is not encrypted and is by default not installed in amazon instance.
但是,如果需要,Linux涉及的步骤:Amazon Instance或Centos
However if needed, steps involved for Linux : Amazon Instance or Centos
-
在实例中安装telnet守护程序:使用
sudo yum install telnet-server
安装telnet-server.软件包telnet
用于客户机程序,以防万一需要使用实例中的telnet客户机进行连接,而练习不需要.
Install telnet daemon in the instance: Install telnet-server using
sudo yum install telnet-server
. Packagetelnet
is for the client program in case one want to connect using telnet client from the instance, not needed for the exercise.
启用telnet守护程序服务:
-默认情况下,该服务在/etc/xinetd.d/telnet
中处于禁用状态,disable
标志需要设置为no
.
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
}
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = yes
}
发布更改后,其外观应如下所示
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}
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
}
如有任何与编辑相关的错误,请验证配置.
sudo chkconfig xinetd on
Verify the configuration in case of any edit related errors.
sudo chkconfig xinetd on
启动telnet服务:
使用sudo service xinetd restart
命令
在AWS Console上启用入站telnet默认端口(23):
在AWS Console EC2/Security Groups/<Your Security Group>/Inbound
中,设置规则
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>
测试telnet连接: 从防火墙中启用的任何客户端测试telnet连接.
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:
>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:
对于其他Linux变体,步骤(工具)将略有不同.
The steps(tools) will vary slightly for other linux variants.
PS:参考 http ://aws-certification.blogspot.in/2016/01/install-and-setup-telnet-on-ec2-amazon.html ,修复了命令中的一些问题.
PS: Referred http://aws-certification.blogspot.in/2016/01/install-and-setup-telnet-on-ec2-amazon.html, fixed few issues in the commands.
这篇关于如何在AWS实例中设置telnet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!