LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I Close or Disable a Port Without IPtables (http://www.linuxquestions.org/questions/linux-software-2/how-do-i-close-or-disable-a-port-without-iptables-929454/)

Doknik 02-15-2012 05:57 AM

How do I Close or Disable a Port Without IPtables
 
Hi,
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.

tronayne 02-15-2012 06:27 AM

One way is in /etc/services (if that's what you're trying to do). Another is in /etc/inetd.conf (but inetd may not be on Redhat anymore?).

Take a look at this thread http://www.linuxquestions.org/questi...se-ports-1515/ for other suggestions.

Hope this helps some.

wpeckham 02-15-2012 01:24 PM

close a port
 
Under Linux and Unix operating systems, a port is only open if something is listening on that port. find the program listening on a port and stop that program, and you have closed that port.

What ports are you seeing open that you wish to close?

lithos 02-15-2012 02:04 PM

Quote:

Originally Posted by wpeckham (Post 4603257)
Under Linux and Unix operating systems, a port is only open if something is listening on that port. find the program listening on a port and stop that program, and you have closed that port.

and if you want you can use:
Code:

root@~#>netstat -tapln
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name 
tcp        0      0 192.168.0.5:53          0.0.0.0:*              LISTEN      15716/named       
tcp        0      0 127.0.0.1:53            0.0.0.0:*              LISTEN      15716/named       
tcp        0      0 127.0.0.1:953          0.0.0.0:*              LISTEN      15716/named       
tcp        0      0 0.0.0.0:25              0.0.0.0:*              LISTEN      16886/master       
tcp        0      0 :::22                  :::*                    LISTEN      5502/sshd         
tcp        0      0 ::1:953                :::*                    LISTEN      15716/named

to see what ports are opened by which service.


All times are GMT -5. The time now is 06:51 AM.