port blocking

How to block a particular (software) port and how to see what ports are blocked?  I am using Redhat 6.2 Linux.
Who is Participating?
fauzdarConnect With a Mentor Commented:
the best way to know what ports are blocked is to see what ports are open. for checking the open ports on you machine use nmap. its a easy utility to use. it tells you what all ports are open.
ipchains comes readily to mind if you want to selectively block access to a given port. If you don't use the port and don't want anyone else to you can simply prevent the port from being accessed by disabling server for the port and/or preventing it from being started by inetd (check inetd.conf).
You can see various services using the command ps -A and see that certain demeons are running the good way to block or stop that service use the inetd.conf file mostly places in /etc/inetd.conf and put a # in front on the line which you dont whant to use.

'ps -aux' will give you a more detailed ideal of what is actually running on your system
Linux# ipchains -L -n

use linuxconf's firewall to block ports.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.