Ubuntu20.04.3中telnet 127.0.0.1时Unable to connect to remote host: Connection refused
本博客旨在自我学习使用,如有任何疑问请及时联系博主
今天遇到个稀奇古怪的问题:
调试emqx的时候一直econnrefused,检查服务时,突然发现在ubuntu上telnet localhost竟然不通???
则往下进行排查,首先查看端口状态
netstat -tnl
发现虽然可以执行telnet,但并没有telnet服务占用端口,即并没有启动telnet服务
解决方案
安装xinetd和telnetd
sudo apt-get install xinetd telnetd
创建inetd.conf文件
sudo vi /etc/inetd.conf
在inetd.conf文件中添加
telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd
完善xinetd.conf文件
sudo vi /etc/xinetd.conf
在defaults配置里面添加
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30

创建telnet文件
sudo vi /etc/xinetd.d/telnet
在文件中输入
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

重启Ubuntu系统
shutdown -r now
重新查看端口状态
netstat -tnl
可以发现多了一个23端口占用,即为telnet服务正在监听23端口
重新测试
telnet localhost
原帖:wolai
Ubuntu20.04.3中telnet 127.0.0.1时Unable to connect to remote host: Connection refused的更多相关文章
- telnet报“Unable to connect to remote host:Connection refused”错误
Linux下面telnet ip 端口号 报错误"Unable to connect to remote host:Connection refused"的时候,大部分是目标机的端 ...
- telnet: Unable to connect to remote host: Connection refused
问题描述: telnet: Unable to connect to remote host: Connection refused 已解决,需要安装telent 服务,请查看下方的链接文章: htt ...
- [Linux] Telnet提示:Unable to connect to remote host: No route to host
出错现象: [root@localhost ~]# telnet 192.168.1.128 Trying 192.168.1.128...telnet: connect to address 192 ...
- telnet: Unable to connect to remote host: No route to host
用iptables -F这个命令来关闭防火墙,但是使用这个命令前,千万记得用iptables -L查看一下你的系统中所有链的默认target,iptables -F这个命令只是清除所有规则,只不会真正 ...
- telnet访问出现telnet:Unable to connect to remote host: No route to host
Linux下的防火墙默认是不允许telnet服务通过的,所以,当防火墙不允许telnet服务通过时就会出现上面的这种情况,可以将防火墙关闭或者勾选允许telnet服务即可解决如上的问题.
- 解决loadrunner录制时 Request Connection: Remote Server @ 0.0.0.0:80 (Service=?) NOT PROXIED! (REASON: Unable to connect to remote server: rc = -1 , le = 0)问题
环境为win7+ie8+loadrunner11,录制脚本回放查看Recoding log 出现如下错误:[Net An. Error ( 7f8:1340)] Request Connecti ...
- 【err】VIDEOIO ERROR: V4L: index 0 is not correct!Unable to connect to camera
前言 新到手一块板子,程序编译成功之后,运行出现错误,不能连接到摄像头. 问题 VIDEOIO ERROR: V4L: index is not correct! Unable to connect ...
- Loadrunner中遇到Failed to connect to server[10061] connection refused错误
(1)run-time setting/browser emulation中,将simulate a new user on each iteration 选项去掉(默认是选中的). 重新运行一切正 ...
- Linux 出现telnet: 127.0.0.1: Connection refused错误解决办法
Linux 出现telnet: connect to address 127.0.0.1: Connection refused错误解决办法 没有xinetd服务: 1./etc/init.d目录中放 ...
随机推荐
- h5跳转高德地图
<a href="https://uri.amap.com/marker?position=经度,纬度&name=所在的位置名称">高德地图</a>
- test_5 排序‘+’、‘-’
题目是:有一组"+"和"-"符号,要求将"+"排到左边,"-"排到右边,写出具体的实现方法. 方法一: l=['-', ...
- unity3d发布安卓出错plese set the package name
发布时报错 参考https://forum.unity.com/threads/where-is-package-name-setting.318839/ 参考https://answers.unit ...
- JavaCV推流实战(MP4文件)
欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...
- hbase region, store, storefile和列簇,的关系
先来一张大图. Hbase上Regionserver的内存分为两个部分,一部分作为Memstore,主要用来写:另外一部分作为BlockCache,主要用于读数据:这里主要介绍写数据的部分,即Mems ...
- elementui表格里面的索引,多选的复用解决
使用elementui表格时,当一个页面通过if判断有多个不同的表格时,其中一个或多个表格想要设置索引或者多选框时,会发现你在第一个里面设置了索引或者多选框,其他的表格都会出现,你在后面的其中一个设置 ...
- 网络支持IPV6地址测试校验与思考
概述 大背景:随着移动端的快速扩张,互联网的规模越来越广阔,早于2011年耗尽的IPV4地址越来越无法满足互联网的网络地址需求,IPV6地址推广进入快车道.实际情况:近期公司应上级部门邀请对公司的主域 ...
- web服务组件
- Nginx请求连接限制
目录 Nginx的请求限制 HTTP协议的连接与请求 连接限制 配置示例 做个演示: 请求限制 配置示例 基本指令 limit_req_zone limit_req zone 做个演示: Nginx的 ...
- vue 快速入门 系列 —— Vue 实例的初始化过程
其他章节请看: vue 快速入门 系列 Vue 实例的初始化过程 书接上文,每次调用 new Vue() 都会执行 Vue.prototype._init() 方法.倘若你看过 jQuery 的源码, ...