1、安裝telnet安全
一、檢測xinetd是否安裝session
telnet服務由xinetd守護,安裝前先看看xinetd是否安裝了.socket
[root@localhost ~]# rpm -qa xinetdtcp
若未安裝輸入yum install xinetd測試
二、安裝telnet服務端rest
[root@localhost ~]#yum install telnet-server server
三、安裝telnet客戶端進程
[root@localhost ~]#yum install telnetip
2、配置telnetcmd
設置開機啓動 [root@locahost ~]#chkconfig telnet on
修改配置文件 vi /etc/xinetd.d/telnet 將」disable= yes」改爲」 disable=no」
若是沒有該文件則建立該文件,內容爲:
# 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
}
爲了安全須要,能夠在該文件中配置鏈接本機的各類限制,如IP和開放時間
3、激活服務
從新啓動守護進程: [root@locahost ~]#service xinetd restart
4、開放端口
查看23端口是否開啓: [root@localhost ~]#netstat -tnl |grep 23
若是沒有返回內容,多是防火牆沒有開放23端口,
[root@localhost ~]# firewall-cmd --query-port=23/tcp
no
顯示23端口沒有開啓使用下面命令開啓23端口(若是提示找不到這個命令使用yum install firewalld安裝)
[root@localhost ~]# firewall-cmd --zone=public --add-port23/tcp --permanent
success
從新加載
[root@localhost ~]# firewall-cmd --complete-reload
success
再次查詢
[root@localhost ~]# firewall-cmd --query-port=23/tcp
yes
再次執行[root@localhost ~]#netstat -tnl |grep 23
若是尚未返回內容能夠嘗試一下重啓.....
5、測試
telnet localhost