您的位置:首页 > 运维架构 > Shell

telnet不能用!!!提示:-bash: telnet: command not found

2016-08-02 15:43 525 查看
1、[root@localhost ~]# telnet

2、 查询了是否安装Telnet包,结果如下:

telnet-server-0.17-47.el6.i686

[
xinetd (pid 2967) 正在运行...

在系统服务里面,也查看过,telnet服务和xinetd也都是工作状态。

centos、ubuntu

yum install telnet-server 安装telnet服务

方法一:使用ntsysv,在出现的窗口之中,将 telnet 勾选起来,然后按下 OK 即可!

#chkconfig telnet on

vi /etc/xinetd.d/telnet

# default: yes

# unencrypted username/password pairs for authentication.

{

socket_type = stream

user = root

log_on_failure += USERID

}

[b]
telnet 是挂在 xinetd 底下的,所以自然只要重新激活 xinetd 就能够将 xinetd 里头的设定重新读进来,所以刚刚设定的 telnet 自然

  # servicexinetd restart

[b]
当你启动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
[b]
下面我们来看一下二种错误:

[
[/b][/b][b][b]
Trying 192.168.1.87...

telnet: Unable to connect to remote host:No route to host
解决方法:这种问题防火墙没有允许telnet服务,连接被阻止,默认CentOS只允许SSH,所以进入其自定义选项,在telnet前打个勾!
第二种 :

Trying 172.25.1.3...

Escape character is '^]'.

Temporary failure in name resolution: Illegal seek

这一个就是/etc/hosts文件配置问题

[linux@localhost ~]$ more
/etc/hosts

# that require network functionality willfail.

::1localhost6.localdomain6localhost6

192.168.1.86

说明:因为客户机的名字不好记就没写进去,内容格式应为127.0.0.1 pcname
[/b][/b][/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: