一.检查
1、[root@localhost ~]# telnet 
bash: telnet: command not found
2、 查询了是否安装Telnet包,结果如下:
[root@localhost~]# rpm -qa telnet*
telnet-server-0.17-47.el6.i686
3、又查询了xinetd的状态:
[root@localhost~]# service xinetd status
xinetd (pid 2967) 正在运行...
4、使用ntsysv命令,开启了Telnet服务;同时,也查看 /etc/xinetd.d/telnet 文件,将将“disable = yes” 改为“disable = no”;也重启了服务 [root@CentOS5/]#service xinetd restart
在系统服务里面,也查看过,telnet服务和xinetd也都是工作状态。
二.安装服务
解决方式,重装一下telnet客户端。
centos、ubuntu
yum list telnet* 查看telnet相关的安装包
yum install telnet-server 安装telnet服务
yum install telnet.* 安装telnet客户端
注意,安装之前要先安装#yum install xinetd (注意在root下安装)因为,telnet要依靠xinetd服务启动,所以要先安装该服务
三.配置telnet 
方法一:使用ntsysv,在出现的窗口之中,将 telnet 勾选起来,然后按下 OK 即可!
方法二:使用chkconfig命令直接开启
#chkconfig telnet on
方法三:直接修改配置文件
vi /etc/xinetd.d/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 = yes
}
只需要将”disable= yes”改成” disable=no”
四、激活服务 
telnet 是挂在 xinetd 底下的,所以自然只要重新激活 xinetd 就能够将 xinetd 里头的设定重新读进来,所以刚刚设定的 telnet 自然
也就可以被激活。
  # servicexinetd restart
或者#/etc/rc.d/init.d/xinetd restart
五.iptables防火墙会阻止telnet,所以需要在iptables允许,用如下命令
当你启动telnet服务后,你可以用netstat –tunlp命令来查看telnet服务所使用的端口,可以发现有23。使用下面命令开启这些端口:
iptables -I INPUT -p tcp --dport 23 -jACCEPT 
iptables -I INPUT -p udp --dport 23 -jACCEPT 
service iptables save //保存 
service iptables restart //重启防火墙 
或者来点狠的!!关闭防火墙! 
service iptables stop 
六、可能的问题: 
下面我们来看一下二种错误:
第一种:
[root@linuxchao~]# telnet 192.168.1.87
Trying 192.168.1.87...
telnet: connect to address 192.168.1.87: Noroute to host
telnet: Unable to connect to remote host:No route to host
解决方法:这种问题防火墙没有允许telnet服务,连接被阻止,默认CentOS只允许SSH,所以进入其自定义选项,在telnet前打个勾! 
第二种 :
[root@testxinetd.d]# telnet 172.25.1.3
Trying 172.25.1.3...
Connected to 172.25.1.3 (172.25.1.3).
Escape character is '^]'.
getnameinfo: localhost: Success
Temporary failure in name resolution: Illegal seek
Connection closed by foreign host.
这一个就是/etc/hosts文件配置问题 
解决方法:我在里面加两个IP地址,内容如下:
[linux@localhost ~]$ more /etc/hosts 
# Do not remove the following line, orvarious programs
# that require network functionality willfail.
127.0.0.1localhost.localdomainlocalhost
::1localhost6.localdomain6localhost6
192.168.1.88
192.168.1.86
说明:因为客户机的名字不好记就没写进去,内容格式应为127.0.0.1 pcname

来源:http://blog.csdn.net/shijiebei2009/article/details/40047077

telnet不能用!!!提示:-bash: telnet: command not found相关推荐

  1. 提示-bash: telnet: command not found的解决方法

    提示-bash: telnet: command not found的解决方法 参考文章: (1)提示-bash: telnet: command not found的解决方法 (2)https:// ...

  2. linux telnet: command not found,提示-bash: telnet: command not found的解决方法

    Linux centos 运行telnet命令,出现下面的错误提示: [root@localhost ~]# telnet 127.0.0.1 -bash: telnet: command not f ...

  3. Linux 7 提示 -bash: ifconfig: command not found

    在 Linux 7 服务器上,如果执行 ifconfig 命令,提示信息如下: -bash: ifconfig: command not found 说明该包没有安装,不能执行 ifconfig 命令 ...

  4. 启动服务提示-bash: mongod: command not found

    mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork 运行如上命令启动mongdb服务,提示命令不存在 ...

  5. linux中使用ps提示 bash: ps: command not found

    背景 最近服务器出现504,正常的情况肯定是链接超时,但是我有遇到的是打开页面直接就超时,一个执行的时间都没有,刷新就又ok了,系统用的是nginx+php-fpm,查到的大多两个建议,一个是增加fp ...

  6. ifconfig命令无法找到,提示bash: ifconfig: command not found

    为什么80%的码农都做不了架构师?>>>    分析问题  1.whereis ifconfig 看一下这个命令在哪个目录下 2.echo $PATH 看一下该目录是否在路经下,注意 ...

  7. CentOS 7 /etc/profile、.bash_profile 环境变量配置,提示-bash: fing: command not found

    1.修改.bash_profile ,在~目录下 [root@ben~]# vim .bash_profile 如果是:PATH=$PATH:$HOME/bin则需要添加成如下: PATH=$PATH ...

  8. bash: vue: command not found

    安装vue的时候提示:bash: vue: command not found 我的原因node.js 环境变量配置有问题,最后添加了环境变量就好了..........

  9. -bash: cd: /usr/bin/mysql:_linux下mysql的卸载、安装全过程amp;amp;mysql安装后bash:mysql:command not found...

    http://blog.sina.com.cn/s/blog_48d5933f0100ts7t.html 卸载mysql 1.查找以前是否装有mysql 命令:rpm -qa|grep -i mysq ...

  10. linux ftp 未找到命令,Linux不能使用FTP 命令 -bash: ftp: command not found

    Linux下登陆 Linux中使用 FTP 命令时出现"-bash: ftp: command not found" Linux中测试搭建 FTP 服务器,刚安装完 vsftpd ...

最新文章

  1. JavaScript和HTML实现的简单计算机
  2. 如何使用Linux的Crontab定时执行PHP脚本的方法
  3. Cookie中文存储页面500问题
  4. 算法---宝藏最优选择问题
  5. 学生成绩管理系统实验报告_学习60天python成果,Python变成学生成绩管理系统
  6. web浏览器_2019版 web 浏览器现状
  7. 严重的 iOS 漏洞可导致拒绝服务或任意代码执行,苹果已修复
  8. R语言ETL工程系列:读写(read/write)
  9. 关于华硕电脑FX80GE风扇模式无法调节
  10. 解读《美国国家BIM标准》 – BIM能力成熟度模型(十二)
  11. Python: scipy.signal.coherence的用法及代码示例
  12. tinyTorrent: 从头写一个 Deno 的 BitTorrent 下载器
  13. 两台路由器的连接方法和无线路由桥接
  14. [BD 41-1629] </zynq_ultra_ps_e_0/SAXIGP3/HP1_QSPI> is excluded from all addressable master spaces.
  15. 聚苯硫醚离子液体|苯硼酸离子液体|聚缩醛离子液体|透明质酸离子液体
  16. R语言之系统聚类(层次)分析之图谱形式完整版
  17. Tomcat课堂笔记
  18. mysql存储过程变量定义_存储过程中MySQL变量定义和赋值
  19. 我的大一结束了 —— 总结与规划
  20. 结构体的大小如何计算

热门文章

  1. 「Anaconda」取消终端命令行自动加载的conda(base)虚拟环境
  2. 75. CPU 100%运行实战案例分析
  3. 关于net::ERR_CONNECTION_ABORTED和Firebug 达到了 Post 请求大小限制的问题
  4. 1.Boost之array
  5. SQL 分组使用案例
  6. Mysql select into outfile NULL值导出的处理方法
  7. arcgis伪节点检查_arcgis建立拓扑分析(检验矢量图)
  8. 树莓派python串口中文输出_Python实现树莓派USB串口通讯
  9. 深入理解ResNet原理解析及代码实现
  10. Linux驱动编程 step-by-step (七) 并发 竞态 (信号量与自旋锁)