LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 06-19-2007, 04:30 AM   #1
stuckz
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Rep: Reputation: 0
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

Last edited by stuckz; 06-19-2007 at 10:14 PM.
 
Old 06-19-2007, 07:06 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
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
 
Old 06-19-2007, 07:31 AM   #3
stuckz
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Original Poster
Rep: Reputation: 0
telnet: Unable to connect to remote host: Connection refused

telnet 203.191.149.57 25
 
Old 06-19-2007, 07:49 AM   #4
xenocide87
LQ Newbie
 
Registered: Jun 2007
Location: USA
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
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.

Last edited by xenocide87; 06-19-2007 at 07:53 AM.
 
Old 06-19-2007, 10:33 PM   #5
stuckz
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 06-20-2007, 06:32 AM   #6
penguinpages
Member
 
Registered: Apr 2007
Posts: 46

Rep: Reputation: 15
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 TROUBLESHOOTINGhard 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.
 
Old 06-21-2007, 02:36 AM   #7
stuckz
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet: Unable to connect to remote host: Connection refused stuckz Fedora - Installation 2 06-19-2007 09:21 AM
ZEBRA :telnet local host 2604 refused?? Y fhameed Linux - Networking 0 12-08-2004 11:19 AM
Remote telnet gets 'Connection refused' ashusharma Linux - Networking 5 01-27-2004 01:12 AM
telnet: Unable to connect to remote host: Connection refused batham Linux - Networking 0 07-07-2003 05:29 PM
telnet:connect to address 127.0.0.1: connection refused sdeven Linux - Networking 6 12-23-2002 12:38 AM


All times are GMT -5. The time now is 08:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration