I want key-only logins from the internet, but on the home network a password is a fine fallback. sshd_config can do both with a Match block.
Set the strict default in the main part of the file, and loosen it for one range at the bottom:
PasswordAuthentication no
Match Address 192.0.2.0/24
PasswordAuthentication yes
Everything after Match applies only when the condition fits, until the next Match line or the end of the file. That is why Match blocks go at the end. A normal option placed below a Match block silently belongs to that block.
You can match on User, Group, Host, LocalPort and a few more, and combine them. To see the result for one case, ask sshd directly:
sudo sshd -T -C addr=192.0.2.50,user=alice,host=laptop | grep -i passwordauthentication
Not every option is allowed inside a Match block. The man page lists the ones that are, and sshd -t complains if you use another.
One caveat about the address: behind a port forward on your router, or a reverse proxy, every connection may appear to come from the router’s own LAN address. Then the whole internet gets the LAN rules. Check the source address in the log before you trust this.
Further reading: sshd_config man page, sshd man page