What are the correct commands to close ports in macOS 26?
I read different instructions to close ports in macOS coming from seemingly questionable sites. For example, I see from China coming often. I then close the port, but later I see it coming again.
The instructions on google and apple community are: sudo lsof -i: (Port Number). Then another one as sudo lsof -i :(Port Number).
I don't know which one is correct, if at all. Is there something else? I need to learn how to identify services to close ports I don't need services for.
The choices given to identify the macOS is not updated so I chose MacOs Sequoia.
Can someone help?
Thank you.
[Edited by Moderator]
Original Title: closing ports in macos 26