检查telnet是否已安装:

[root@hostuser src]# rpm -q telnet-server
package telnet-server is not installed
[root@hostuser src]# telnet 192.168.81.129
bash: telnet: command not found...

rpm -qa |grep telnet

没有则安装,有跳过

yum install telnet-server -y && yum install telnet.* -y

启动telnet 服务

[root@hostuser src]# sudo service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service

确认启动telnet服务

[root@hostuser xinetd.d]# ps -ef | grep xinetd
root 33139 1 0 12:11 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root 35218 30125 0 12:27 pts/0 00:00:00 grep --color=auto xinetd

尝试一下
[root@hostuser src]# telnet localhost
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
[root@hostuser src]# netstat -tnl |grep 23

没反应检查telnet默认端口23不在开通防火墙23端口

开放23端口

firewall-cmd --zone=public --add-port=23/tcp --permanent

重启防火墙
firewall-cmd --reload
检查端口开启23情况

[root@hostuser xinetd.d]# firewall-cmd --zone=public --list-ports
8989/tcp 8686/tcp 40127/tcp 23/tcp

再尝试一下
[root@hostuser src]# telnet localhost
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

检查 cd  /etc/xinetd.d

检查telnet文件存不存在,不存在touch telnet

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 = no
}

 若存在直接修改

disable = no

然后重启 xinetd

[root@hostuser src]# sudo service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service

设置xinetd开机自启动:

systemctl enable xinetd.service

检查telnet效果

[root@hostuser xinetd.d]# telnet localhost
Trying ::1...
Connected to localhost.
Escape character is '^]'.

Kernel 3.10.0-957.10.1.el7.x86_64 on an x86_64
hostuser login:

问题解决

centos解决bash: telnet: command not found...&& telnet: connect to address 127.0.0.1: Connection refused拒绝连接的更多相关文章

  1. Centos出现-bash: unzip: command not found的解决办法

    利用unzip命令解压缩的时候,出现-bash:  unzip: command not found的错误. unzip——命令没有找到,其原因肯定是没有安装unzip. 利用一句命令就可以解决了.  ...

  2. Centos提示-bash: make: command not found的解决办法

    一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make.vim等常用命令,直接yum安装下即可: yum - ...

  3. 解决-bash: lsb_release: command not found

    今天想判断系统版本,没想到没有lsb_release,lsb_release是查看系统版本信息的工具.当然我们也可以用其他的命令来解决,但这个问题还是解决掉. 系统:centos 6.41.先检查有没 ...

  4. centOS出现 -bash: vim: command not found

    问题描述 用centos 的主机的時候, 用 vim 时出现 -bash: vim: command not found. 只能使用 vi. 那么如何安裝 vim 呢? 解决步骤 1.查看是否安装 输 ...

  5. 解決 centos中-bash: vim: command not found

    用centos 的主机的時候, 用 vim 时出现 -bash: vim: command not found. 只能使用 vi. 那么如何安裝 vim 呢? 输入 rpm -qa|grep vim ...

  6. CentOS系统bash: groupadd: command not found问题

    如果我们需要在CentOS执行新建用户组命令的时候,需要进入到ROOT权限,如果你用以下命令: 1 su2 su root 进入到ROOT账户,那么会出现上述的错误信息:“bash: groupadd ...

  7. 解决 bash: vue command not found

    背景  : win10 使用  yarn  全局 安装  vue/cli 后   yarn  global add  @vue/cli 提示安装成功 使用vue create   提示  bash: ...

  8. 解决bash: mysql: command not found 的方法

    root@DB-02 ~]# mysql -u root-bash: mysql: command not found 原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下 ...

  9. linux环境中iostat命令的安装,解决-bash: iostat: command not found问题

    需求说明: 今天在测试环境的主机上,准备通过iostat来查看系统的io情况,发现没有该命令 [root@testvm Packages]# iostat -bash: iostat: command ...

随机推荐

  1. CentOS 7 下挂载NTFS盘及开机自动挂载

    一.工具 NTFS-3G 二.安装2种安装方式 2.1.yum安装 yum install NTFS* 2.2.编译安装 下载 解压 wget https://tuxera.com/opensourc ...

  2. vue axios使用

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. Spring AOP编程(二)-AOP实现的三种方式

    AOP的实现有三种方式: l         aop底层将采用代理机制进行实现. l         接口 + 实现类 :spring采用 jdk 的动态代理Proxy. l         实现类: ...

  4. 消息队列(六)--- RocketMQ-消息消费

    文章部分图片来自参考资料,侵删 概述 我们从前面的发送流程知道某个主题的消息到了broker 的 messageque 里,假如让我们来设计一个消息队列的消费者过程,那么多个消费者应该如何消费数量较少 ...

  5. 【12】(难&精)【DFS】矩阵中的路径

    题目 矩阵中的路径 请设计一个函数,用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径.路径可以从矩阵中的任意一格开始,每一步可以在矩阵中向左.右.上.下移动一格.如果一条路径经过了矩阵的某一 ...

  6. Docker配置阿里云镜像源

    Docker默认拉取镜像是从这里拉取(https://hub.docker.com/),拉取的速度让人...,所以是配置国内镜像源,拉取速度十分惊人 一.版本要求 Docker版本:1.10以上 二. ...

  7. Python实现一个桌面版的翻译工具【新手必学】

      Python 用了好长一段时间了,起初是基于对爬虫的兴趣而接触到的.随着不断的深入,慢慢的转了其它语言,毕竟工作机会真的太少了.很多技能长时间不去用,就会出现遗忘,也就有了整理一下,供初学者学习和 ...

  8. python:面试算法题

    ''' 1.买卖股票的最佳时机给定一个数组,它的第?i?个元素是一支给定股票第?i?天的价格. 如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润. 注意你不 ...

  9. 2016 Google code jam 大赛

    二,RoundC import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundE ...

  10. wordpress Error establishing a database connection问题

    最近这场大雨,快把帝都给淹了,我也快被这不定向问题折磨疯了,本来把项目放在A服务器,nginx ,php7,mysql,然后换到了B服务器,环境一模一样,结果呢,传上去就出现了 哎,话说我的配置也没啥 ...