CentOS 7.4安裝telnet服務端
阿新 • • 發佈:2018-12-22
一、檢查是否安裝telnet
- [[email protected] Solin]# rpm -qa | grep telnet
- [[email protected] Solin]#
二、安裝telnet客戶端、服務端(如果已安裝telnet則跳過此步驟)
yum -y install telnet*
三、檢查是否安裝xinetd
- [[email protected] Solin]# rpm -qa | grep xinetd
- [[email protected]
Solin]#
四、安裝xinetd服務(如果已安裝xinetd則跳過此步驟)
yum -y install xinetd
五、telnet服務安裝之後,預設是不開啟服務,修改檔案/etc/xinetd.d/telnet來開啟服務
注:第一次修改,此檔案若不存在,可自己vim建立修改:修改 disable = yes 為 disable = no
- [[email protected] xinetd.d]# pwd
- /etc/xinetd.d
- [[email protected] xinetd.d]# ls
- chargen-dgram daytime-stream echo-dgram time-dgram
- chargen-stream discard-dgram echo-stream time-stream
- daytime-dgram discard-stream tcpmux-server
- [[email protected] xinetd.d]# vim telnet
- [[email protected] xinetd.d]# cat telnet
- # default: yes
- # description: The telnet server servestelnet 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
- }
- [[email protected] xinetd.d]#
六、啟動telnet和依賴的xinetd服務
- [[email protected] xinetd.d]# systemctl restart xinetd.service
- [[email protected] xinetd.d]# ps -ef | grep xinetd #檢視xinetd是否啟動
- root 6100 1 0 10:20 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
- root 6159 3770 0 10:21 pts/1 00:00:00 grep --color=auto xinetd
- [[email protected] xinetd.d]# ps -ef | grep telnet #檢視telnet是否啟動
- root 6239 3770 0 10:22 pts/1 00:00:00 grep --color=auto telnet
- [[email protected] xinetd.d]#
七、測試telnet
在windows下開啟cmd命令列視窗,輸入telnet 192.168.1.10 回車,然後輸入使用者名稱密碼。
八、設定服務開機啟動
將xinetd服務加入開機自啟動:systemctl enable xinetd.service
將telnet服務加入開機自啟動:systemctl enable telnet.socket
閱讀更多