LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-11-2007, 04:05 PM   #1
joeneeld
LQ Newbie
 
Registered: Oct 2007
Location: Indiana
Distribution: Fedora 6
Posts: 6

Rep: Reputation: 0
telnet connection refused from localhost


Recently installed telnet on Fedora 6. I am unable to telnet localhost. Before I get a bunch of responses about not using telnet, this machine is offline and I only installed telnet so that I could access port 2947. I am trying to use gpsd, and the instructions for using it are to telnet that port once the daemon is running. If anyone knows another way to use gpsd, I'd gladly do that instead:

-All firewalls are disabled
-telnet file in xinetd.d is set to disable = no

THANK YOU FOR Help!
 
Old 10-11-2007, 04:16 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
well you appear to just want to use the telnet *client* for other purposes. in that case, this has nothing at all to do with telnet itself. as such there aren't the security risks... as far as what problems you have, well firstly ignore anythign at all about a telnet server, xinetd etc... as it's irrelevant. i'd be looking to see if anythign is actually listening on port 2947 in the first place...
 
Old 10-11-2007, 05:06 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
What command are you using when you get the connection refused message (please past the full command)?
 
Old 10-11-2007, 05:11 PM   #4
joeneeld
LQ Newbie
 
Registered: Oct 2007
Location: Indiana
Distribution: Fedora 6
Posts: 6

Original Poster
Rep: Reputation: 0
#telnet localhost 2947
#telnet localhost
#telnet 1
#telnet 127.0.0.1

all give same message

telnet: connect to address ::1: Connection refused
telnet: Unable to connect to remote host: Connection refused
 
Old 10-11-2007, 05:15 PM   #5
joeneeld
LQ Newbie
 
Registered: Oct 2007
Location: Indiana
Distribution: Fedora 6
Posts: 6

Original Poster
Rep: Reputation: 0
also...
#netstat -tna
Proto Recv -Q Send -Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:2947 0.0.0.0:* LISTEN
 
Old 10-11-2007, 05:26 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Seems like nothing is listening on port 2947. Either you don't have gpsd running, or it's not configured to listen on that port.

You can list all programs listening for (TCP) connections like this (run as root or with sudo):
Code:
netstat -t -l -p
Maybe you can see it listening to another port, or maybe it's just not listening.
 
Old 10-11-2007, 05:42 PM   #7
joeneeld
LQ Newbie
 
Registered: Oct 2007
Location: Indiana
Distribution: Fedora 6
Posts: 6

Original Poster
Rep: Reputation: 0
I'm not really sure what I'm looking at. Here is the netstat


.
.
.
tcp 0 0 *:gpsd *:* LISTEN
3486/lt-gpsd
.
.
.
tcp 0 0 *:x11 *:* LISTEN
2947/X
.
.
.

I left out some of the stuff because I can't easily copy between the two computers.
 
Old 10-11-2007, 06:07 PM   #8
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Mmm, looks like it is listening. Not sure what the problem is then. The mask 0.0.0.0 means it should accept connections coming from anywhere. I'm not sure what is going on. Presumably what you would expect is that when you telnet you either see some sort of gpsd protocol output, or simply nothing (if the gpsd protocol expects the client to send data first before any response).
 
Old 10-12-2007, 01:01 AM   #9
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I might have this completely wrong (not an expert on netstat output), but is above output not stating that the gpsd port is 3486?

Have you tried telnet localhost gpsd ?
 
Old 10-12-2007, 09:06 AM   #10
joeneeld
LQ Newbie
 
Registered: Oct 2007
Location: Indiana
Distribution: Fedora 6
Posts: 6

Original Poster
Rep: Reputation: 0
I get the same message from telnet localhost gpsd. Connection refused
 
Old 10-12-2007, 09:15 AM   #11
joeneeld
LQ Newbie
 
Registered: Oct 2007
Location: Indiana
Distribution: Fedora 6
Posts: 6

Original Poster
Rep: Reputation: 0
Is there a way to use ssh to do what I'm trying to do with telnet?
 
Old 10-12-2007, 09:37 AM   #12
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Quote:
Originally Posted by joeneeld View Post
Is there a way to use ssh to do what I'm trying to do with telnet?
You didn't really describe what you are trying to accomplish in enough detail at the start of the thread - I assumed it was just a connection test.

It is not uncommon as a quick check of daemons which listen on TCP ports to check if they are installed properly and running with a quick telnet to the port they listen to. The "connection refused" which you are getting suggests something is not right in the gpsd setup.

If you managed to get a connection, and the gpsd communication protocol is textual, it should be possible not only to connect but also to issue some commands and get some sort of response back as further proof that the program is running. You can do a similar thing to check a web server is running by telnetting to port 80 and doing a "GET www.yourdomain.com" just to make sure it's running.

ssh isn't a good substitute for this sort of check as it requires a lot more interacting with the other end before it will complete the connection, and will generally drop connections to anything other than sshd demons on the other end.

netcat (command = nc) can be used as an alternative to telnet for these simple checks, but if you are getting "connection refused" responses from telnet, I don't think the problem is the program - the cannot successfully open the port, so it doesn't really matter which program you are using, you will probably get the same response.

The question is: why does gpsd not accept connections (since it does appear to be listening to the right port). I am out of ideas. Maybe there is a gpsd setup and troubleshooting guide somewhere?
 
  


Reply

Tags
port, telnet


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 localhost 3306 connection refused farnazhm Linux - General 6 05-15-2007 11:57 AM
localhost connection refused. Sapient Linux - Networking 6 01-17-2006 05:52 AM
telnet localhost: Connection refused? neocookie Linux - Networking 10 08-16-2005 04:15 PM
Connection to localhost refused?!? a_priebe47 Slackware 4 09-01-2004 10:05 PM
connection to localhost refused digitalgravy Linux - Networking 5 05-03-2004 05:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration