1

I'm trying to telnet from my windows box into a service running on a known-available port on a mac laptop, but the connection is getting refused.

  • I can telnet into the service locally.
  • Firewalls are set to pass-through on both ends.
  • Wiresharking the line shows that the SYN gets responded to with a RST, ACK. No connection is established.

What might be going on here? (Thanks in advance!)

  • Just a note: it looks like the service may be bound to 'localhost' instead of to my IP or the loopback. I'll try these and update once I have results. – Joseph Weissman Jul 16 '11 at 17:50
  • 1
    `localhost` is the loopback, and that will prevent connection from outside the device. Try 0.0.0.0. – Shane Madden Jul 16 '11 at 18:01
  • Don't use telnet, use ssh. – Paul Tomblin Jul 16 '11 at 18:17
  • @Paul, I didn't realize I could specify the port to be used with ssh. (Also, the service at the other end isn't SSH.) Can you clarify a bit what you're suggesting? – Joseph Weissman Jul 16 '11 at 18:22
  • @Shane, this seems to be the problem. Thank you so much. Maybe you could expand your comment into an answer? – Joseph Weissman Jul 16 '11 at 18:24
  • 3
    @Paul Tomblin: Debugging/testing a text based protocol (like SMTP, HTTP, IMAP) is a perfectly valid use case for telnet (the program). SSH is not a replacement in this case. – Sven Jul 16 '11 at 20:28

1 Answers1

2

localhost is the hostname for the loopback address - that will be the resolved hostname for both 127.0.0.1 and ::1. If a service is bound to one of these addresses, it will only be available to attempts to connect locally to the loopback address.

A service that needs to listen for connections over the network should listen on a non-loopback address; you can manually specify the addresses to listen on, or go with the "easy route" of binding to 0.0.0.0 (for IPv6, ::) to listen on all addresses (including the loopback).

Shane Madden
  • 114,520
  • 13
  • 181
  • 251