By default sshd listens on every address the machine has. When a server has a public interface and a private one, I’d want SSH only on the private side.
In /etc/ssh/sshd_config:
ListenAddress 192.0.2.10
ListenAddress [2001:db8::10]:22
You can repeat the line for several addresses, with or without a port. Without a port, sshd uses the address with each Port line. Check the syntax and restart:
sudo sshd -t && sudo systemctl restart ssh
Now ss -tlnp | grep sshd should show only those addresses, not 0.0.0.0:22.
The trap is timing. If the address does not exist yet when sshd starts, for example a VPN or Tailscale address that comes up a few seconds later, sshd fails to bind and you have no SSH at all after a reboot. For an address like that, either make the ssh service wait for that interface, or keep a second ListenAddress on something that is always there, like the LAN address. And test from a second terminal before you close the one you are working in.
A firewall rule gets you a similar result. ListenAddress is nice because the port is simply not open on the other interface, even if someone flushes the firewall.
Further reading: sshd_config man page