Linux安裝telnet

Linux安裝telnet

安裝環境:CentOS 6.5

一、安裝telnet
1、檢測telnet-server的rpm包是否安裝
[root@localhost ~]# rpm -qa telnet-server
若無輸入內容,則表示沒有安裝。出於安全考慮telnet-server.rpm是默認沒有安裝的,而telnet的客戶端是標配。即下面的軟件是默認安裝的。

2、若未安裝,則安裝telnet-server,否則忽略此步驟

[root@localhost ~]#yum install telnet-server  

3、檢測telnet-server的rpm包是否安裝
[root@localhost ~]# rpm -qa telnet
telnet-0.17-47.el6_3.1.x86_64

4、若未安裝,則安裝telnet,否則忽略此步驟

[root@localhost ~]# yum install telnet

二、重新啓動xinetd守護進程

由於telnet服務也是由xinetd守護的,所以安裝完telnet-server,要啓動telnet服務就必須重新啓動xinetd
[root@locahost ~]#service xinetd restart

三、測試

我們先來查看TCP的23端口是否開啓正常
[root@localhost ~]#netstat -tnl |grep 23
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
如果上面的一行存在就說明服務已經運行了。如果netstat命令沒有返回內容,我們就只好繼續進行更深入的配置了。

四、連接到 memcached
telnet ip 端口,如:
[root@localhost proc]# telnet localhost 11211
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.

表明連接成功。
(stats查看狀態,flush_all:清楚緩存)

五、遇到的問題
1、telnet: connect to address 127.0.0.1: Connection refused的錯誤信息
[root@localhost software]# telnet localhost 11211
Trying ::1…
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1…
telnet: connect to address 127.0.0.1: Connection refused

[root@localhost software]# rpm -qa telnet-server
檢查原因是沒有安裝telenet-server的服務。
解決方法:[root@localhost software]# yum install telnet-server

2、[root@localhost ~]#netstat -tnl |grep 23 沒有返回內容
解決方法:
[root@localhost ~]vi /etc/xinetd.d/telnet
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = yes
}
將disable項由yes改成no。

本片博客系轉載,若有侵權,請聯繫博主刪除。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章