In OSX if I type netstat I can see certain things that have an established connection. I don't want to change any settings to close these, I just want to be able to close whatever I ports I choose in the terminal. How do you do that?
Linux – How to manually close a port
linuxmacosnetworkingosx lionport
Best Answer
You can't close an open socket just like this. Ideally, you would just kill the process that has established the connection.
Check your connections with
lsof
(netstat
won't show the process), filtering the output with whatever connection status you want:Or, to get the port, e.g.
17500
:Then, just kill the process. For example:
Kill Skype:
Note though that this won't prevent the connections from being made – something you have to specify in your Firewall preferences.