一.检查
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客户端
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@test xinetd.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
方法一:使用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@test xinetd.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://www.filewatcher.com/m/telnet-0.17-47.el6_3.1.x86_64.rpm.58196-0.html
相关推荐
linux下提示bash-command not found.docx
我构建了hadoop集群。我们一定会写一个shell脚本去每一个节点上去jps,查看每个节点的进程情况。 原先以为shell很简单: #!/bin/bash #查看每个节点运行情况 for((host=101;...-bash: jps: command not found
bash: vi: command not found, 场景: 因为 docker里面没有这个命令,我们安装一下 apt-get update apt-get install vim 如果 这个时候 安装也还是会出现 异常 root@446d7cf1606c:/etc/mysql# apt-get update ...
前几天重装了mysql,装好之后navicat一直正常可以对mysql进行操作,但是今天要使用命令行进行操作时遇到-bash: mysql: command not found的问题。 总结一下解决办法: 这个问题的出现是两个原因 1 .bash_profile中...
NULL 博文链接:https://myeyeofjava.iteye.com/blog/1898291
-bash: mysqldump: command not found问题解决
解决Centos6.7:-bash: ./DrClientLinux: /lib/ld-linux.so.2: bad ELF 的所有rpm包
http-server安装成功后,提示 ~bash command not found 在安装目录下却可以,其实是没有配置环境变量的缘故 网上搜到的什么vim ~/.zshrc不适合我,因为我报的错不是zsh: command not found: 解决办法, 1、在mac终端...
linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案 今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都没看 yum remove yum 然后就杯具了… [root@localhost ~]#...
今天登录阿里云后不知道怎么回事,一直报:-bash: ls: command not found 原因: 环境变量PATH被修改了 解决办法: 执行命令: export PATH=/bin:/usr/bin:$PATH 上边的方法执行完成,解决了问题,当关掉当前的...
1、查看是否真设置IP地址:命令行中输入ip addr,看到ip地址。 2.确认sbin目录是否存在;在命令行中输入:cd /sbin 3、确认是否安装ifconfig命令:在sbin目录中输入ls | grep ‘if’,没有则说明没有安装。...
bashfdiskcommand not found 解决办法
cp -pr /etc/skel/.bash* /home/test/ #/home/test是用户目录 改变用户家目录:usermod -md /tmptest test 以上就是小编为大家带来的解决ssh远程登陆linux显示-bash-4.1$的问题全部内容了,希望大家多多支持软件开发...
官方离线安装包,亲测可用
解决bash: mysql: command not found 的方法,需要的朋友可以参考一下
git-bash.exe
Linux下使用使用tar、zip、unzip报错:command not found(未找到命令)