解决telnet: connect to address 127.0.0.1: Connection refused的错误信息(2)
来源:互联网 发布:软件检测员待遇怎么样 编辑:程序博客网 时间:2024/04/29 22:52
检查是否安装成功。
[root@localhost software]# rpm -qa telnet-server
telnet-server-0.17-47.el6_3.1.i686
已经安装好telnet-server服务啦,但由于telnet服务是由xinetd守护的,所以我们需要重新启动xinetd。
[root@localhost software]# service xinetd restart
停止 xinetd:[确定]
正在启动 xinetd:[确定]
启动成功,我们来测试一下连接是否正常。
[root@localhost software]# netstat -tnl | grep 23
tcp 0 0 0.0.0.0:36232 0.0.0.0:* LISTEN
tcp 0 0 :::23 :::* LISTEN
[root@localhost software]# telnet localhost 23
Trying ::1...
Connected to localhost.
Escape character is '^]'.
CentOS release 6.4 (Final)
Kernel 2.6.32-358.11.1.el6.i686 on an i686
login:
如果无法连接到telnet,哪么需要修改/etc/xinetd.d/telnet文件
[root@localhost software]# vi /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet 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行前加#注释掉,或者把yes改为no
然后重新启动xinetd服务
[root@localhost software]# service xinetd restart
停止 xinetd:[确定]
正在启动 xinetd:[确定]
或者需要开启防火墙的23端口,我们可以配置一下防火墙,添加telnet的23端口服务
[root@localhost software]# setup
文本模式设置工具 1.19.9 (c) 1999-2006 Red Hat, Inc
┌─────┤ 选择一种工具 ├─────┐
│ │
│ 防火墙配置 │
│ 键盘配置 │
│ 网络配置 │
│ 系统服务 │
│ 验证配置 │
│ │
│ ┌──────────┐ ┌──────┐ │
│ │ 运行工具 │ │ 退出 │ │
│ └──────────┘ └──────┘ │
│ │
│ │
└──────────────────────────┘
<Tab>/<Alt-Tab> 在元素间切换 | 使用 <Enter>
我们也可以采用命令行形式添加规则到防火墙中
# vi /etc/sysconfig/iptables
添加一条配置规则,如要想开放23的端口,如下所示:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT
重启iptables
# /etc/init.d/iptables restart
看下状态
# /etc/init.d/iptables status
(1) 重启后永久性生效:
开启:chkconfig iptables on
关闭:chkconfig iptables off
(2) 即时生效,重启后失效(即重启后防火墙自动开启):
开启:service iptables start
关闭:service iptables stop
- 解决telnet: connect to address 127.0.0.1: Connection refused的错误信息(2)
- telnet: connect to address 127.0.0.1: Connection refused解决
- telnet: connect to address 127.0.0.1: Connection refused
- 【转载】telnet: connect to address 127.0.0.1: Connection refused
- telnet: connect to address 127.0.0.1: Connection refused
- telnet: connect to address 127.0.0.1: Connection refused
- telnet: connect to address 127.0.0.1: Connection refused问题
- telnet 安装---telnet: connect to address 127.0.0.1: Connection refused问题 ----
- telnet: connect to address 192.168.1.103: Connection refused
- 阿里云安装svn失败,提示telnet: connect to address Connection refused的解决办法
- ssh: connect to host 127.0.0.1 port 2222: Connection refused
- UE4 connect to 127.0.0.1 port 52314 failed: Connection refused)
- linux telnet 之 telnet: Unable to connect to remote host: Connection refused
- 解决连接mongoDB出现问题:MongoDB : Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
- Ubuntu 安装配置SSH(ssh: connect to host localhost port 22: Connection refused问题的解决)
- Ubuntu 安装配置SSH(ssh: connect to host localhost port 22: Connection refused问题的解决)
- connect() failed (111: Connection refused) while connecting to upstream的解决
- linux memcached telnet 出现 Connection refused ,Unable to connect to remote host
- 正向反向代理的理解
- [Leetcode]264. Ugly Number II
- 改善java程序之字符串
- bootstrap 下拉选择框select实现从服务器加载option
- ubuntu环境下如何解决svn提交出现can't check path '/home/...'
- 解决telnet: connect to address 127.0.0.1: Connection refused的错误信息(2)
- Effetive Objective - C 1.Objective 9
- Ubuntu系统挂载新硬盘方法
- 【使用工具和软件汇总】
- Struts2向action传对象数组
- Swift:Command failed due to signal: Segmentation fault: 11
- 编译AT91SAM9G25的linux步骤及出现的问题
- 安装Tomcat9闪退
- Android数据库两种操作方式介绍: SQLite与ORMLite