【问题标题】:Always connection refused using telnet使用 telnet 总是拒绝连接
【发布时间】:2014-01-08 18:52:49
【问题描述】:

我在本地使用 telnet 时遇到问题。

我发出了这个命令并得到了这些结果:

[root@myserver ~]# telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

这是我的 iptables 结果:

[root@myserver ~]# iptables --line-numbers -n -L
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:25 
2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:465 

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

我还有什么需要做的吗?

【问题讨论】:

  • 您的 telnet 服务器是否仅限于监听特定 IP?然后尝试那个而不是localhost。
  • 您是否在 localhost 上运行 SMTP 服务器?这就是通常在端口 25 上侦听的内容。

标签: smtp centos telnet


【解决方案1】:

默认的 telnet 端口是 23。你真的打开了 25 端口吗?我建议逐步检查您的设置。尝试不使用 iptables 并确保您的 telnet 工作正常。然后应用 iptables 规则。

【讨论】:

  • 如何检查我的设置?以及如何取消应用 iptables 规则?
  • 通常你可以像这样停止 iptables。 # /etc/init.d/iptables stop 但取决于分布。还要检查你的 SELinux。 # getenforce 如果您得到“强制执行”结果,则将 # setenforce 0 暂时禁用。顺便说一句,您想通过 telnet 与您的 SMTP 服务器通话吗?如果是这样,忘记我之前提到的端口 23。
猜你喜欢
  • 2015-06-03
  • 2016-12-26
  • 2015-09-30
  • 1970-01-01
  • 2018-10-27
  • 1970-01-01
  • 1970-01-01
  • 2015-12-25
  • 2016-03-27
相关资源
最近更新 更多