第一步查询是否安装telnet
# rpm -qa |grep telnet
telnet-0.17-47.el6_3.1.i686
第二步安装telnet
#yum install xinetd
#yum install telnet-server
#yum install telnet
第三步配置telnet
使用chkconfig命令直接开启
#chkconfig telnet on
查看服务运行的状态 #service xinetd status
启动telent服务 #service xinetd start
查看该服务开机自启动情况 #chkconfig --list xinetd
设置该服务在3和5级别运行的时候开机自启动 #chkconfig ---level 35 xinetd on
第四步重启xinetd,激活telnet
# service xinetd restarttelnet 是挂在xinetd 下的,所以只要重新激活xinetd就能激活telnet。
第五步配置防火墙
# iptables -I INPUT -p tcp --dport 23 -jACCEPT# iptables -I INPUT -p udp --dport 23 -jACCEPT
# service iptables save //保存
# service iptables restart //重启防火墙
效果图:
附:telnet下对应的常用命令
close close current connection
logout forcibly logout remote user and close the connection
display display operating parameters
mode try to enter line or character mode ('mode ?' for more)
open connect to a site
quit exit telnet
send transmit special characters ('send ?' for more)
set set operating parameters ('set ?' for more)
unset unset operating parameters ('unset ?' for more)
status print status information www.2cto.com
toggle toggle operating parameters ('toggle ?' for more)
slc change state of special charaters ('slc ?' for more)
auth turn on (off) authentication ('auth ?' for more)
encrypt turn on (off) encryption ('encrypt ?' for more)
forward turn on (off) credential forwarding ('forward ?' for more)
z suspend telnet
! invoke a subshell
environ change environment variables ('environ ?' for more)
? print help information