RedHat Linux 安装完成以后默认提供使用SSH方式进行远程连接,如果想通过Telnet方式远程连接到Linux需要我们进行一些设置。

注:ssh使用非对称算法加密(公钥加密和私钥解密),其能提供安全的端到端连接,推荐使用SSH方式远程连接到Linux。

Telnet使用明文方式(不提供安全机制)进行信息交互,其无法保障密码等重要信息的安全,一般不使用Telnet远程连接到Linux。

Telnet配置方法如下:

1. 开启telnet服务

  

   执行命令chkconfig --list telnet,用以查看Telnet服务是否开启,返回结果为telnet         

  

  

        

  

2. 对telnet服务进行连接测试

  

Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel 2.6.18-8.el5 on an i686
login:

  

Login incorrect

  

3. 更改/etc/securetty使root身份可以登录系统

  

console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11

   

   

   

   

......

pts/0
pts/1

   

   

Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel 2.6.18-8.el5 on an i686
login: root
Password:
Last login: Tue Feb 17 11:04:34 from 192.168.10.58
[root@linux ~]#

另:如果开启了iptables防火墙功能则无法成功连接Telnet服务,可以使用以下指令允许23端口进入