I am developing a go app on a server(mac-mini) where I connect via ssh. I restart the app many times: go run main.go
Problem is, that I dont have access to the graphical ui – "Firewall Options…".
I really like to have the firewall on for security reason and poke minimal holes in it only when needed.
Is there any way to set and allow a port to be open, for incoming connections from the terminal?
Best Answer
Configure the firewall to be permissible for selected applications and services.
https://raymii.org/s/snippets/OS_X_-_Turn_firewall_on_or_off_from_the_command_line.html
Reboot for the change to take effect.
/usr/libexec/ApplicationFirewall/socketfilterfw
allows you to configure applications through the firewall. The tool provides its own help and documentation.For example, to grant an application incoming connections, you can use