LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2009, 01:50 PM   #1
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Question Open/Close Ports


Hi all,

I have a problem with port number basics. I have RHEL-5 at my workplace, and trying to connect to a remote desktop within LAN. But telnet is giving some error like, telnet can't connect as port:23 is not there. Since 23 is the default port for telnet, so can't say why it is coming out so...I did netstat but didn't see port:23 at all.

Can somebody will help me in knowing how to open or close a specific port ? What is the basic behind port connection, and how it can't connect to some port which is specifically designated for a particular application ?

Thank you in advance,
Kapil.
 
Old 10-09-2009, 02:01 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi.

This will be due to IPtables, in RHEL you should be able to use the setup command (just enter 'setup' on the command line) to configure iptables and set telnet as allowed. Alternatively if you could supply the output of the following command enclosed in code tags from the server.

iptables -nvL
 
Old 10-09-2009, 02:05 PM   #3
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Question

Hi r3sistance,

Thank you for the prompt reply...
I will provide the output once I reach office tomorrow. But what I would like to know is how can we open or close a port ? What is the process for doing so ?

Thank You,
Kapil.
 
Old 10-09-2009, 02:12 PM   #4
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by kapilbajpai88 View Post
Hi r3sistance,

Thank you for the prompt reply...
I will provide the output once I reach office tomorrow. But what I would like to know is how can we open or close a port ? What is the process for doing so ?

Thank You,
Kapil.
A port is either accessible or not, and this is under the control of your local firewall, and whether there is a server making that port available on the machine you are trying to contact.

To make Telnet available, for example, your local firewall must permit outgoing Telnet connections, and the server you are contacting must be running a Telnet server.

By the way, you are much better off setting up and using SSH for this sort of thing -- it has it all over Telnet. Telnet is very, very insecure. And SSH can do things undreamt of by Telnet:

Secure Shell Fun and Games
 
Old 10-09-2009, 02:12 PM   #5
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi Kapil,

setup will open/close some of the basic ports for basic services else you have to use the iptables command to manually enter in rules (and then save the configuration once it's in a good/secure state).

An example of a line that should manually enter the rule is
iptables -I INPUT -p TCP --dport 21 -m state --state NEW -j ACCEPT

Also you may require the following rule should it not exist.
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

Alternatively can you confirm you actually have a service listening for telnet, that is telnet-server is installed? If this isn't installed then telnet will not work.

Also to note, telnet should be safe on a LAN, however i'd still advise SSH over telnet since SSH is a much more secure protocol and should allow for SSH tunneling what may come in useful if you are going to use VNCserver.
 
  


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
open ports for utorrent using iptables n close smpt to that ports shtorrent00 Linux - Networking 2 09-30-2008 03:34 PM
how to close open ports glorsplitz Linux - Networking 3 09-30-2006 10:10 AM
How do I close open ports ??? apache Linux - Security 2 07-20-2004 07:44 PM
Which ports should I keep open and which close?? apache Linux - Security 3 07-19-2004 08:31 AM
How do i close my open ports??? Synth218 Slackware 10 07-06-2003 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:12 AM.

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