LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   telnet: Unable to connect to remote host: Connection refused (https://www.linuxquestions.org/questions/fedora-35/telnet-unable-to-connect-to-remote-host-connection-refused-562882/)

stuckz 06-19-2007 04:30 AM

telnet: Unable to connect to remote host: Connection refused
 
hi All,

pls help me, i've a problem with telnet
before that sorry if my english bad.. :(
i have fedora 6 instaled in my computer and im using sendmail for email
for example my ip : 203.191.149.57

this is /etc/hosts file :

127.0.0.1 localhost.localdomain localhost stuckz.cjb.net
203.191.149.57 stuckz.cjb.net localhost

im telnet to localhost 25 -> succeed

telnet to stuckz.cjb.net 25 -> succeed

telnet to 203.191.149.57 25 -> failed with error message
telnet: connect to address 203.191.149.57: Connection refused
telnet: Unable to connect to remote host: Connection refused

pls give me solution

thx

wjevans_7d1@yahoo.co 06-19-2007 07:06 AM

Quote:

telnet to 203.191.149.57 -> failed with error message
Did you just

Code:

telnet 203.191.149.57
or did you

Code:

telnet 203.191.149.57 25

stuckz 06-19-2007 07:31 AM

telnet: Unable to connect to remote host: Connection refused
 
telnet 203.191.149.57 25

xenocide87 06-19-2007 07:49 AM

Quote:

Originally Posted by stuckz
this is /etc/hosts file :

127.0.0.1 localhost.localdomain localhost stuckz.cjb.net
203.191.149.57 stuckz.cjb.net localhost

im telnet to localhost 25 -> succeed

telnet to stuckz.cjb.net 25 -> succeed

telnet to 203.191.149.57 -> failed with error message
telnet: connect to address 203.191.149.57: Connection refused
telnet: Unable to connect to remote host: Connection refused

Did you try "telnet 203.191.149.57" and leaving the port number off? My guess is that either you have a router or your ISP does not accept incoming telnet connections.

In your hosts file, you have "127.0.0.1" and "203.191.149.57" linked to both "stuckz.cjb.net" and "localhost" which is probably why you can get in using those names. Your computer just picks the "127.0.0.1" address since it's the local machine. Hopefully I'm making some sense here... :)

To test whether your router or ISP is blocking telnet, Google "Shields UP!" and click on the first result. Click the "Proceed" button and do a common port scan. If port 25 is listed as "Closed" or "Stealth", then your router/ISP is probably blocking telnet.

EDIT: Oops, I just remembered that port 25 is SMTP, not telnet (port 23). Now I understand what your trying to do, connect to your SMTP server. The cause is probably the same though, so try my advice and see if it helps.

stuckz 06-19-2007 10:33 PM

I have edit the /etc/hosts being like this :

203.191.149.57 stuckz.cjb.net localhost
127.0.0.1 localhost.localdomain localhost stuckz.cjb.net

but still dont work :(

penguinpages 06-20-2007 06:32 AM

Quote:

I have edit the /etc/hosts being like this :

203.191.149.57 stuckz.cjb.net localhost
127.0.0.1 localhost.localdomain localhost stuckz.cjb.net
First off this is not your issue. but this is also not how to set up a host file.

what you just listed here is that you are attempting to telnet back to yourself.....

203.191.149.57 = you

I recommend you change the host file to be a bit more "normal"

Quote:

# IP FQDN CNAME CNAME ....
127.0.0.1 localhost.localdomain localhost
203.191.149.57 stuckz.cjb.net stuckz

Now as stated. The host file should have nothing to do with your issue as your not trying to "telnet hostname" but are using the direct IP. Linux will try to look it up but even in the case if your layout of hosts, it would have referred you to 'attempting stuckz.cjb.net'

BASIC IP TROUBLESHOOTING:(hard to explain .. easy to do)
1) First test physical (done, as you can ping other hosts)

2)Set baseline of bad condition by testing application connection to other hosts(done as you can telnet to other hosts and this shows your host is not blocking the application stack)

3) Focus on the host that is reflecting bad condition
a) ping that host(if yes then you have physical and basic host communication)If you don't then see if any other host can ping it.
b) telnet 'hostname' 'application tcp port' (if yes then firewalls are not an issue) you did this by directly pointing at the TCP port after hostname BUT check other TCP ports on the remote host to validate you can route to the offending host. Try SSH vs Telnet (seeing as anyone using telnet should be taken out and beaten with a wet taco)
c) IF you can test the offending host directly. Get to the host physically and 'telnet 127.0.0.1'. If this fails then I would surmise that the local telnet services are down. If they pass, check the firewall or routes on that host for return delivery back to you( ping would likly be quick way)

d) IF you can not get into the remote host. See if other hosts can. If other hosts can then the target host has some ACL in the router, firewall, hostaccess.deny, or TCP wrappper setting to stop your IP from gaining access.

stuckz 06-21-2007 02:36 AM

thanks penguinpages for your replies
i've edit my hosts file just like your suggestion
and i've found the solution too..

I just edit file /etc/mail/sendmail.mc and give remark, like this:

dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl -> remarks

and the result... it works guys :)

thx


All times are GMT -5. The time now is 03:40 AM.