LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-06-2013, 12:57 AM   #1
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Rep: Reputation: Disabled
Not able to telnet on ports. Error-Connection refused.


Hi Experts,

I am not able to telnet on specified ports--21344,21354 and 21364. I have a colo server and I am able to ping and ssh to it on port 22. When I try telnet, it comes up with the message:-

telnet 10.52.52.163 21344
Trying 10.52.52.163...
telnet: connect to address 10.52.52.163: Connection refused

>>Firewall on the server is turned off using :-
/etc/init.d/iptables stop
/etc/init.d/iptables save

>>Tried to capture packets using tcp dump on the colo server as:-
# tcpdump -i em2 -n src host 10.164.253.216
where 10.164.253.216 is the ip from where I am trying to telnet on my colo server.

>>Asked the Network ENgineer to check the perimetre firewall just to make sure that these ports are opened and he confirmed the same.

Please let me know if I am missing something here. Your quick response will be highly appreciated.
 
Old 08-06-2013, 01:38 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
probably no server process listens on that port (21344)
 
Old 08-06-2013, 01:40 AM   #3
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Original Poster
Rep: Reputation: Disabled
Thanks for the prompt reply. So how can I make this set-up work...how can I make the server listen on port 21344 ?
 
Old 08-06-2013, 02:37 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
That is your job. That port is not configured by default, I have no any idea what is installed on that host. Probably you have simply forgotten to start your server,
 
Old 08-06-2013, 02:48 AM   #5
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Original Poster
Rep: Reputation: Disabled
I have RHEL installed.

cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)

uname -a
Linux W2W-LIME-MHW 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

Most of the documnets I read and researched mainly points in using iptables for opening ports. I have tried that as well, but wihtout any success.

cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Tue Aug 6 03:49:25 2013
*filter
:INPUT ACCEPT [183:13776]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [98:10920]
-A INPUT -i em1 -p tcp -m state --state NEW -m tcp --dport 21344 -j ACCEPT
COMMIT


There has to be some other way to make this work. Let me know if anything else is required from my end.

Your quick action will be highly appreciated.
 
Old 08-06-2013, 03:19 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
How did you get those port numbers?
 
Old 08-06-2013, 09:54 AM   #7
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
You have to start the service which works on these ports. iptables is like a firewall of your OS which will allow,deny or forward the traffic.here you have stopped the iptables hence it is allowing but the service is not running that is the reason the telnet showing this message.
for eg if ssh runs on port no. 22 and if it is stopped ,the port no. 22 will not be listened.If you do telnet to port 22 same error message will occur.


With the help of netstat command you can check the port is listening or not

If it is tcp based protocol use command
Quote:
netstat -tanp
Or UDP based then
Quote:
netstat -uanp
 
1 members found this post helpful.
Old 08-07-2013, 04:49 AM   #8
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
You need a service/services running on the RHEL box, which listen(s) on the mentioned ports. For example, if you run
Code:
telnet 80
...then you need to have a web server on your RHEL machine listening to port 80 (web servers listen to this port by default, ex. Apache httpd).

Hope this helps
 
1 members found this post helpful.
Old 08-13-2013, 03:21 PM   #9
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
I'm not at all certain, but I believe that 'connection refused' means that your telnet attempt was able to try and connect to your server without being blocked by any firewall and without being dropped by iptables and your server said: "i have no process listening on that port so scram!". Before you can telnet to some port on your machine, you need a program of some kind that is set up to listen on that port. Apache (and other web servers) listen on port 80 by default but can be configured to listen on other ports. ssh listens on port 22. Other programs (ftp, mail, etc.) listen on still other ports.

What program do you have configured (if any) to listen on those ports you are talking about?
 
Old 08-13-2013, 03:46 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by srijivdimri View Post
I have RHEL installed.
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)
Right off, have you contacted Red Hat support?? You are PAYING for RHEL, right??? That entitles you to support and access to their knowledgebase.
Quote:
Most of the documnets I read and researched mainly points in using iptables for opening ports. I have tried that as well, but wihtout any success.

There has to be some other way to make this work. Let me know if anything else is required from my end.
Your quick action will be highly appreciated.
If you need a 'quick' reply, then I suggest you contact Red Hat. We VOLUNTEER our time, so asking us to hurry up is fairly rude. Again, if you don't have a service LISTENING on that port, then nothing will reply, no matter what network/firewall configuration you try. What service is running on port 21344?? What are you trying to connect to, and what results are you expecting?

Also, based on your posting signature, you've got CCIE, CCSP, and RHCE certifications...these are very, VERY basic questions you should already have answers to, or easily be able to figure out, since you're 'certified'.

Last edited by TB0ne; 08-13-2013 at 03:47 PM.
 
1 members found this post helpful.
  


Reply



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 connection refused Marcusj2 Linux - Networking 22 09-07-2006 10:35 PM
Telnet: error connection refused v1nc3nt Linux - Newbie 3 03-24-2006 05:11 AM
telnet, connection refused rsmereka Linux - Security 4 03-25-2005 02:14 PM
telnet connection refused turbo_acura Linux - Networking 8 11-21-2004 09:07 AM
Telnet: Connection Refused Erice60rng Linux - Security 7 01-20-2003 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:56 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
Open Source Consulting | Domain Registration