Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to disable or close a couple of ports on a RHEL 5.3 Redhat server, without using IPtables .IPtables is already switched off (disabled)on this system.Is there any alternative way of closing or disabling these ports either via command line or via changes in configuration files .

Your help would be greatly appreciated.

share|improve this question

migrated from Feb 16 '12 at 2:58

This question came from our site for professional and enthusiast programmers.

What are you trying to accomplish? If you change a service so that it listens to an internal IP, then that port on the public interface will be "disabled". – cjc Feb 16 '12 at 3:15

If you want to actually close the port a daemon is listening on you will have to disable the daemon or make it listen on the loopback interface.

Since most daemons are not of any use if they are not serving any clients i would start by disabling everything you don't actually need.

share|improve this answer

As mentioned, simply disable any services you don't need first. The commands service and chkconfig on RHEL can help you determine what is running, stop services and disable them at boot time.

Then, use tcpwrappers where possible to restrict access to various services that need to run for a particular set of clients but should be denied to everyone else.

share|improve this answer
Many Thanks for your help , i really appreciate this – Dominiqs Feb 21 '12 at 18:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.