yum install xinetd
yum install telnet
yum install telnet-server
直接上命令,没有 yum 可以参考博文 “使用DVD光盘或者ISO作为本地YUM源”、“配置 Linux 国内 yum 源”。
装好 telnet 后,可以进行配置优化:
1)vi /etc/xinetd.d/telnet 修改 disable = yes 为 disable = no #设置开机启动
2)service xinetd restart #重启服务 xinetd
3)service iptables stop #关闭防火墙
4)vi /etc/sysconfig/iptables
5)-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT #防火墙只开 23 端口
6)chkconfig iptables on
7)service iptables start #开启防火墙
安装成功后,telnet 本机 IP 测试(如 telent 192.168.168.100.100),返回 “Connected to 192.168.100.100” 表示成功;返回 “command not found” 表示失败。
若需模拟端口、测试防火墙端口开通否、亦或是验证服务运行,可参考博文 “Windows/Linux环境下模拟服务端口方法”。