Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ?
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.
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 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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.