Assume UserA is allowed to log in by SSH to a server from public networks as well as from within private ones.
Is there any option to restrict password-enabled logins to the private networks while enforcing public key authentication for the rest of the world?
What I have so far in my config
AllowUsers email@example.com firstname.lastname@example.org usera
How can I enable usera to log in from email@example.com/24 by public key or password, and enforce pubic key login for usera from any other network?
Does something imilar to the following work? What is the exact notation syntax?
# no password login from the public PasswordAuthentication no ChallengeResponseAuthentication no # allow password login from private network Match Users firstname.lastname@example.org/24 email@example.com/24 PasswordAuthentication yes
Thanks for any enlightenment.
PS: Reason for this setup is to enable password-login from within the internal network as a measure of last resort if anything else fails.