Não é possível conectar-se ao telnet a partir do ip externo

1

Eu tenho um servidor postfix em execução em um VPS kimsufi, eu instalei roundcube nele, e está tudo ok. O problema é que, quando eu tento me conectar de outro servidor, tenho um tempo limite:

telnet whys.fr 25
Trying 5.196.66.189...
telnet: Unable to connect to remote host: Connection timed out

aqui está minha saída netstat:

netstat -ntpul | grep 25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      17643/master    
tcp6       0      0 :::25                   :::*                    LISTEN      17643/master

E as regras atuais do iptables:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
fail2ban-ssh  tcp  --  anywhere             anywhere             multiport dports ssh

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain fail2ban-ssh (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

telnet do localhost está funcionando muito bem:

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 whys.fr ESMTP Postfix (Debian/GNU)
ehlo whys.fr
250-whys.fr
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.

O servidor está hospedado no datacenter da OVH e a porta 25 não está bloqueada:

nmap -p 25 whys.fr

Starting Nmap 6.47 ( http://nmap.org ) at 2015-02-20 15:16 CET
Nmap scan report for whys.fr (5.196.66.189)
Host is up (0.019s latency).
rDNS record for 5.196.66.189: ns330237.ip-5-196-66.eu
PORT   STATE    SERVICE
25/tcp filtered smtp

Nmap done: 1 IP address (1 host up) scanned in 0.72 seconds

Eu também verifiquei nas listas de spam de e-mail para ver se meu ip estava em uma delas, e não é.

Como posso fazer para aceitar o telnet 25 de fora? eu não tenho ideia agora, já vi todas as perguntas sobre isso no SF e muitas delas no resto da internet.

    
por Supamiu 20.02.2015 / 15:19

2 respostas

3

De acordo com os documentos do nmap:

filtered

Nmap cannot determine whether the port is open because packet filtering prevents
its probes from reaching the port. The filtering could be from a dedicated
firewall device, router rules, or host-based firewall software. These ports
frustrate attackers because they provide so little information. Sometimes they
respond with ICMP error messages such as type 3 code 13 (destination unreachable:
communication administratively prohibited), but filters that simply drop probes
without responding are far more common. This forces Nmap to retry several times
just in case the probe was dropped due to network congestion rather than
filtering. This slows down the scan dramatically.

Então parece que sua porta está simplesmente bloqueada por um firewall em algum lugar. Talvez o seu provedor local? Porque quando tento me conectar a ele, obtenho uma conexão:

$ telnet whys.fr 25
Trying 5.196.66.189...
Connected to whys.fr.
Escape character is '^]'.
220 whys.fr ESMTP Postfix (Debian/GNU)

Infelizmente, não é incomum que o ISP bloqueie a conexão direta com a porta 25 fora de sua própria rede, para evitar que bots em máquinas clientes enviem spam diretamente.

    
por 20.02.2015 / 15:36
1

A primeira coisa que eu faria antes de continuar seria testar a porta 25 de ponta a ponta com uma ferramenta como netcat .

A ferramenta vem de fábrica com a maioria das distribuições Linux. Por exemplo, no CentOS eu iria parar o postfix para liberar a porta 25. Então eu iria começar o netcat assim:

# nc -l 25

Em seguida, no cliente remoto, eu começaria assim:

# nc {ip of remote server} 25

Em seguida, qualquer coisa que você digitar em uma das extremidades deverá ser refletida / visível na tela. Se não é, então o seu porto está sendo bloqueado ao longo do caminho.

    
por 20.02.2015 / 15:42