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!)

link|improve this question
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
@Shane, thanks -- trying this now. – Joseph Weissman Jul 16 '11 at 18:11
Don't use telnet, use ssh. – Paul Tomblin Jul 16 '11 at 18:17
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. – SvenW Jul 16 '11 at 20:28
show 2 more comments
feedback

1 Answer

up vote 2 down vote accepted

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).

link|improve this answer
1  
You can use netstat -an | grep LISTEN to see what ports and addresses your TCP listeners are bound to. – Gordon Davisson Jul 17 '11 at 5:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.