Linux中telnet客戶端與服務端的安裝與配置(yum安裝)

NO IMAGE

Linux中telnet客戶端與服務端的安裝與配置(yum安裝)

2016年11月10日 10:58:24

閱讀數:15500

Telnet服務的配置步驟如下:

 

一、安裝telnet軟體包(通常要兩個)。

 

  1、 telnet-client (或 telnet),這個軟體包提供的是 telnet 客戶端程式;

 

  2、是 telnet-server 軟體包,這個才是真正的 Telnet server 軟體包!

 

  安裝之前先檢測是否這些軟體包已安裝,方法如下:

    [[email protected] ~]# rpm -q telnet

    telnet-0.17-38.el5

    telnet客戶端一般預設情況是已安裝

    [[email protected] ~]# rpm -q telnet-server

    無表示未安裝

二、安裝telnet-client (或 telnet)

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

三、安裝telnet-server

 

 

yum方式是最為便捷的線上包安裝工具。

安裝方式都可以直接搜尋關鍵字,類似於:

命令:yum telnet

 

[[email protected] 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這個源

[[email protected] 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!
[[email protected] xinetd.d]#

安裝成功。

可再搜尋遍看是否已經寫入環境中。

 
  1. [[email protected] xinetd.d]# rpm -qa | grep telnet

  2. telnet-0.17-47.el6.x86_64

  3. telnet-server-0.17-47.el6.x86_64

發現telnet-server已經安裝成功。

 [更改配置檔案,將telnet服務設定為預設啟動,非必須]

查詢xinetd.d所管轄的所有配置檔案所在目錄。

[[email protected] xinetd.d]# cd /etc/xinetd.d
[[email protected] 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
[[email protected] 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服務

[[email protected] xinetd.d]# service xinetd restart
Stopping xinetd:                                           [FAILED]
Starting xinetd:                                           [  OK  ]

可直接start,這樣就不會有關閉服務時候報的那個錯,畢竟那個時候服務還不存在。

測試telnet服務

[[email protected] 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/[email protected]/blog/static/117720534201272223820221/

文章標籤: telnet linux yum

個人分類: linux

相關熱詞: linuxμ  linux。  linux$$  linux   linux的和$