Linux 安装 telnet 服务(RedHat)

查看当前是否安装telnet

[knight@knight ~]$ yrpm -qa | grep telnet
[knight@knight ~]$ 

查看当前可获得安装包

[knight@knight ~]$ yum list | grep telnet
telnet.x86_64                                  1:0.17-47.el6               RHEL 
telnet-server.x86_64                           1:0.17-47.el6               RHEL 

安装所有与telnet相关的包

[knight@knight ~]# yum -y install telnet*
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Package 1:telnet-0.17-47.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package telnet-server.x86_64 1:0.17-47.el6 will be installed
--> Processing Dependency: xinetd for package: 1:telnet-server-0.17-47.el6.x86_64
--> Running transaction check
---> Package xinetd.x86_64 2:2.3.14-39.el6_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                               Arch                           Version                                      Repository                    Size
======================================================================================================================================================
Installing:
 telnet-server                         x86_64                         1:0.17-47.el6                                RHEL                          37 k
Installing for dependencies:
 xinetd                                x86_64                         2:2.3.14-39.el6_4                            bs                           122 k

Transaction Summary
======================================================================================================================================================
Install       2 Package(s)

Total download size: 158 k
Installed size: 312 k
Downloading Packages:
(1/2): telnet-server-0.17-47.el6.x86_64.rpm                                                                                    |  37 kB     00:00     
(2/2): xinetd-2.3.14-39.el6_4.x86_64.rpm                                                                                       | 122 kB     00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                 1.6 MB/s | 158 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : 2:xinetd-2.3.14-39.el6_4.x86_64                                                                                                    1/2 
  Installing : 1:telnet-server-0.17-47.el6.x86_64                                                                                                 2/2 
Installed products updated.
  Verifying  : 1:telnet-server-0.17-47.el6.x86_64                                                                                                 1/2 
  Verifying  : 2:xinetd-2.3.14-39.el6_4.x86_64                                                                                                    2/2 

Installed:
  telnet-server.x86_64 1:0.17-47.el6                                                                                                                  

Dependency Installed:
  xinetd.x86_64 2:2.3.14-39.el6_4                                                                                                                     

Complete!

修改配置文件并启动服务

[knight@knight~]# vim /etc/xinetd.d/telnet 
# 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 #默认是yes 改为no
}

[knight@knight~]# service xinetd start
Starting xinetd:                                           [  OK  ]

测试和退出

[knight@knight~]# telnet 47.88.xx.xx 22
Trying 47.88.xx.xx...
Connected to 47.88.xx.xx.
Escape character is '^]'.
^]                                            # ctrl + ] 
telnet> quit                                  #quit+回车 
Connection closed.
[knight@knight~]# 

关闭服务

[knight@knight~]# service xinetd stop
Stopping xinetd:                                           [  OK  ]

你可能感兴趣的:(Linux 安装 telnet 服务(RedHat))