Linux中telnet客户端与服务端的安装与配置(yum安装)

Telnet服务的配置步骤如下:

一、安装telnet软件包(通常要两个)。


  1、 telnet-client (或 telnet),这个软件包提供的是 telnet 客户端程序;


  2、是 telnet-server 软件包,这个才是真正的 Telnet server 软件包!


  安装之前先检测是否这些软件包已安装,方法如下:

    [root@localhost ~]# rpm -q telnet

    telnet-0.17-38.el5

    telnet客户端一般默认情况是已安装

    [root@localhost ~]# rpm -q telnet-server

    无表示未安装

二、安装telnet-client (或 telnet)

yum安装telnet-server,命令:yum -y install telnet,就能安装了。

三、安装telnet-server

yum方式是最为便捷的在线包安装工具。

安装方式都可以直接搜索关键字,类似于:

命令:yum telnet

[root@crxjtest xinetd.d]# yum list |grep telnet
...
Trying other mirror.
telnet.x86_64                          1:0.17-47.el6                 @anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2
telnet-server.x86_64                   1:0.17-47.el6                 local

发现有telnet-server.x86_64这个源

[root@crxjtest xinetd.d]# yum install telnet-server.x86_64
...
Trying other mirror.
Setting up Install Process
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-33.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


===============================================================================================================
 Package                      Arch                  Version                         Repository            Size
===============================================================================================================
Installing:
 telnet-server                x86_64                1:0.17-47.el6                   local                 37 k
Installing for dependencies:
 xinetd                       x86_64                2:2.3.14-33.el6                 local                120 k


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


Total download size: 157 k
Installed size: 312 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 157 k
---------------------------------------------------------------------------------------------------------------
Total                                                                          1.2 MB/s | 157 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:xinetd-2.3.14-33.el6.x86_64                                                               1/2 
  Installing : 1:telnet-server-0.17-47.el6.x86_64                                                          2/2 
Installed products updated.


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

Dependency Installed:
  xinetd.x86_64 2:2.3.14-33.el6                                                                       
Complete!
[root@crxjtest xinetd.d]#

安装成功。

可再搜索遍看是否已经写入环境中。

[root@crxjtest xinetd.d]# rpm -qa | grep telnet
telnet-0.17-47.el6.x86_64
telnet-server-0.17-47.el6.x86_64

发现telnet-server已经安装成功。

 [更改配置文件,将telnet服务设置为默认启动,非必须]

查询xinetd.d所管辖的所有配置文件所在目录。

[root@crxjtest xinetd.d]# cd /etc/xinetd.d
[root@crxjtest xinetd.d]# ls
chargen-dgram   cvs	    daytime-stream  discard-stream  echo-stream  tcpmux-server  time-dgram
chargen-stream  daytime-dgram  discard-dgram   echo-dgram      rsync	telnet	 time-stream
[root@crxjtest xinetd.d]# vi telnet

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

备份telnet文件,再vi打开,将disable值赋为no。

修改完之后,:wq保存并退出

开启telnet服务

[root@crxjtest xinetd.d]# service xinetd restart
Stopping xinetd:                                           [FAILED]
Starting xinetd:                                           [  OK  ]

可直接start,这样就不会有关闭服务时候报的那个错,毕竟那个时候服务还不存在。

测试telnet服务

[root@crxjtest xinetd.d]# telnet localhost
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Red Hat Enterprise Linux Server release 6.2 (Santiago)
Kernel 2.6.32-220.el6.x86_64 on an x86_64
login:

测试正常。


参考文章:http://www.tuicool.com/articles/67be6f

http://blog.csdn.net/frank_jb/article/details/40192349

http://blog.163.com/wspjing@126/blog/static/117720534201272223820221/

你可能感兴趣的:(linux)