Macos – How to close a port (seen open on netstat)

macmacosnetstatport

I used netstat and I see some ports open that I want closed. How do I close them?

The computer is a Mac running OS X

Best Answer

Try using

lsof | grep portnumber

to get the process that has it opened.

You could also use the -i option to let lsof do the filtering for a TCP port

lsof -i TCP:portnumber

Related Question