How do i find what ports are being used.

I need to know how to tell what ports are being used and by what. I recently bought Apple Remote Desktop and have been pretty impressed but I have one computer here that won't let me Observe or Control. I think it is because the G4 in question has a program using port 5900. I need to confirm this is there any way that I can see if this port is being used?

Thanks
Moderith

PPC G4 4gb's ram, Mac OS X (10.4.11)

Posted on Jan 15, 2008 2:32 PM

Reply
7 replies

Jan 15, 2008 3:35 PM in response to Moderith

The only way I know is through Terminal and I don't really feel comfortable explaining it. If you don't mind going this far into your Mac, this site explains commands used to what ports are being used by the server and system. It seems simple enough but look for yourself first. There may be a less invasive procedure. Good luck and wait for more advice.




<http://www.macos-x-server.com/wiki/index.php?title=Network ServicePorts>

Jan 15, 2008 9:52 PM in response to Moderith

Hi Moderith--

Welcome to the Apple Discussions.

Look in your Utilities folder for the Network Utility program. Open it, and choose "Port Scan" from the row of tabs in its window. If you're not running Network Utility on the problematic G4, use the G4's IP address. But if you're actually on the G4, use "localhost".

Note that if you check the open ports on the G4 from another computer, you won't see as many as if you check it from the G4 itself. That's because some ports are only local. For example, I have enabled the mail server on my Macs, but only to deliver mail, not relay it. So if I do a port scan using "localhost", I see port 25 open, but it's not open from another computer.

charlie

Jan 15, 2008 10:12 PM in response to Moderith

Have you tried using Network Utility, found in /Applications/Utilities? In the Info window you can get the Mac's IP address and then in the Port Scan window you can use that to have the Mac self-scan and obtain a list of all open ports.

If you're comfortable using Unix commands in Terminal, you may want to investigate the netstat command.

Jan 16, 2008 1:00 AM in response to Moderith

Network Utility will tell you what ports are open, but not necessarily which application is using them.

A more precise method is the tool lsofwhich can show you, amongst other things, active network connections, including the application that's using them.

<pre class=command>sudo lsof -i -P</pre>

The -i restricts lsof to show IP connections (as opposed to all the other things it can show). -P turns off port name conversion so that it shows port numbers rather than service names, which is easier when you know the port number you're after.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do i find what ports are being used.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.