LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Where do i find a list of my ports? (https://www.linuxquestions.org/questions/linux-security-4/where-do-i-find-a-list-of-my-ports-160960/)

zerofocus 03-22-2004 10:57 AM

Where do i find a list of my ports?
 
Can some one tell me where to find a list of my ports on my linux redhat 9.0 server?

Also is there a list on the internet that discribes what each port is used for?

I need to lock down some unused ports and am kinda confused as which ones i really dont need and also which ones do i really need that i probably am unfamililar with. I know I have to leave ssh and apache open but are there other ones?

I'm going to be using this for a basic web server... I'm administrating it with webmin (https:10000) and the built in stuff that came with clark connection (https:81) This wont use email and wont need to do any thing fancy... I'm going to run Mysql and php on it and very very little perl if any.

This server is a clark connect distro and I positive it uses RedHat 9.0 as background work.. (hope I said that write.)

so if any one can refer me to any good sites that explain this it would be a great help. The threads on this forum have also been very helpful.

~Matt

muah 03-22-2004 11:19 AM

try 'netstat' not sure about parameters but something like 'netstat --listen' should display list of listening sockets I think.

mgatny 03-22-2004 12:25 PM

List TCP ports that are listening for connections, and the program that is running the daemon:
netstat -lt --program

Same thing for UDP:
netstat -lu --program

A mapping of service name to port number can be found in /etc/services. Refer to http://www.iana.org/ for more info.

You can also port scan yourself for open ports with a program like nmap (http://insecure.org/), which may already be installed on your system.

Some ports that get turned on by default that you probably want turned off:
lpd on port 515
portmapper on port 111 (unless you are mounting NFS volumes)
sendmail on port 25

If you want to stop services, and prevent them from starting on boot, here's an example using sendmail:
/etc/init.d/sendmail stop
chkconfig --del sendmail


All times are GMT -5. The time now is 09:45 AM.