You are not logged in.
Anyone know an easy way to get a systemd service to open/close a port on a firewall when it's started/stopped?
Offline
Why would you want to?
If the service isn't running then there is nothing listening on the port, having it firewalled doesn't increase security
Offline
Why would you want to?
If the service isn't running then there is nothing listening on the port, having it firewalled doesn't increase security
I guess it makes me feel safer there is one less port open that another possible program could use it for.
Offline
I wrote this a while ago and haven't used it in a long time but you might find it useful: https://github.com/Stebalien/punchfw
However, as slithery said, this shouldn't be necessary.
1. If you're running an untrusted program, you're screwed.
2. Most "nice" programs pick different reasonably unique ports so, even if one does decide to listen on some port, it's unlikely to be the same port (unless you have, e.g., two bittorrent daemons).
Offline
I wrote this a while ago and haven't used it in a long time but you might find it useful: https://github.com/Stebalien/punchfw
However, as slithery said, this shouldn't be necessary.
1. If you're running an untrusted program, you're screwed.
2. Most "nice" programs pick different reasonably unique ports so, even if one does decide to listen on some port, it's unlikely to be the same port (unless you have, e.g., two bittorrent daemons).
Thanks, that is pretty much what I was talking about. I guess I agree about leaving them open is probably okay.
Offline