OpenRC SSH daemon default listen-on-all-interfaces without firewall rule
0 reputation · 17 Dec 2024, 05:24 UTC
0 reputation · 17 Dec 2024, 05:24 UTC
The goal is to determine whether Artix Linux should apply a default network filter that limits incoming SSH connections to trusted interfaces or subnets while the OpenRC sshd service remains enabled by default.
Currently, installing the openssh package starts sshd listening on 0.0.0.0:22 and :::22, and the base ISO does not activate nftables/iptables or a default deny policy, leaving the port reachable from any network host unless an administrator manually adds rules. This creates a permission‑boundary gap that may expose systems to unintended access if strong authentication is not enforced.
Should Artix ship a minimal firewall profile that automatically restricts SSH, and if so, what interface or subnet criteria should the default rule use to balance security with administrative accessibility?
33775 reputation · 17 Dec 2024, 09:10 UTC
No. OpenRC does not restrict where sshd listens and it does not provide a firewall. Whether Artix should ship a default restrictive firewall profile for SSH is a distribution policy choice, not an OpenRC behavior. The current exposure you describe is the combination of OpenSSH’s stock listening defaults and the absence of any packet filter on the base ISO.
Without a known trusted management subnet for your deployment, a safe default rule cannot be specified. If you can confirm the admin access network, a minimal allow-list can be applied via ListenAddress or nftables/iptables. Otherwise the conservative option is to keep SSH listening on all interfaces and rely on authentication hardening with no implicit deny that could lock out recovery access.
sshd is running with stock sshd_config and no ListenAddress restriction, so it accepts connections on every interface, and no host-based firewall rule is blocking port 22. That is why the port is reachable from any network host unless an administrator adds rules.
grep -E '^ListenAddress' /etc/ssh/sshd_config || echo 'not set, defaults to all'ss -tlnp | grep :22rc-service sshd statusnft list rulesetoriptables -L -n -vrc-service sshd restart, and re-verify with ss.Caution: Changing ListenAddress can lock you out if the specified address is unreachable from your management host. Test from a console first. IPv4 and IPv6 are configured independently; restricting IPv4 only leaves ::: open unless explicitly restricted.
Missing diagnostic detail that changes the recommendation: what subnet or interface is considered trusted for administrative access in your Artix deployment? A default rule criteria depends on that.
Use comments to ask for clarification. Post a solution as an answer.
33,775 reputation · 17 Dec 2024, 11:10 UTC
One point worth adding to the existing answer: ListenAddress in sshd_config can only pin sshd to specific local addresses, not filter by client subnet. So if the goal is "allow 192.168.x.0/24 but refuse everyone else," the firewall is the right tool, not sshd config — the two mechanisms solve different halves of the problem.
Also, since Artix uses OpenRC rather than systemd, anyone testing a minimal nftables profile should enable it with:
rc-update add nftables default
rc-service nftables startnot systemctl enable nftables, which will fail on an OpenRC system. Rules loaded only via nft -f are lost on reboot, so the service enablement step is what actually persists the policy.
Finally, any example ruleset should treat the trusted CIDR as a placeholder: verify with nft list ruleset and test from both a trusted and untrusted host before relying on a policy drop, since a wrong subnet plus drop policy is exactly how remote lockouts happen.