Account Links: Cart | Register | Log In

Skip to content

Red Hat Knowledgebase
Red Hat Knowledgebase Search
Article translations:
Currently Being Moderated

如何在红帽企业Linux上打开Telnet?

Article ID: 11404 - Created on: Jul 22, 2008 6:00 PM - Last Modified:  Jun 7, 2009 9:19 PM

[英文原文] How do I turn Telnet on for a Red Hat Enterprise Linux system?

相关版本:Red Hat Enterprise Linux 3,Red Hat Enterprise Linux 4,Red Hat Enterprise Linux 5

红帽建议,为了安全目的,在进行远程连接时使用SSH代替Telnet。使用Telnet时,密码会以明文进行传输,基于这个原因,root用户在默认情况下无法通过Telnet登录。 为了打开Telnet,要先确定已经安装了 telnet-server和telnet 的RPM包。


# rpm -qa | grep telnet
telnet-server-0.17-26.EL3.2
telnet-0.17-26.EL3.2

不用介意软件包的版本,红帽网络(RHN)会为订阅频道提供最新的软件包。 如果没有 telnet-server 和 telnet 软件包,可以从安装光盘上安装RPM包,或者通过 up2date或者yum 工具在RHN订阅中下载和安装这些软件包。如:


# up2date telnet-server telnet

一旦安装了这些软件包,检查/etc/xinetd.d/telnet文件确认 disable = yes 已经被修改为disable = no。


# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
       flags           = REUSE
       socket_type     = stream
       wait            = no
       user            = root
       server          = /usr/sbin/in.telnetd
       log_on_failure  += USERID
       disable         = no
}

使用 chkconfig 命令启用Telnet Server,使用service命令重新启动xinetd服务,可以使telnet服务马上生效。 注意:为了实现以上样例中的功能,并不需要拥有上述样例中的特定软件版本。软件版本会根据操作系统版本而定,你必须使用root用户来执行这个命令。同样,如果碰到"command not found"的提示,那么需要使用命令的完整路径,如需要查找 chkconfig 的路径,可以使用 which chkconfig 命令查找全路径 /sbin/chkconfig.


# chkconfig --list telnet
telnet          off
# chkconfig telnet on
# chkconfig --list telnet
telnet          on
# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

chkconfig命令会使Telnet Server在下次启动之后可用。需要注意的是Telnet Server是xinetd守护进程的一部分。为了使telnet servers马上可用,使用service xinetd restart命令重启 xinetd 进程。然后就可以马上进行telnet登录。


[root@jaws root]# telnet special-ed
Trying 10.1.1.11...
Connected to special-ed.example.com (10.1.1.11).
Escape character is '^]'.
Red Hat Enterprise Linux AS release 3 (Taroon Update 5)
Kernel 2.4.21-32.ELsmp on an i686
login: jason
Password:
Last login: Sat Jul  2 14:46:57 from jaws
Feedback from users like yourself is a critical factor in helping us make the Red Hat Knowledgebase as useful as possible.

More Like This

  • Retrieving data ...