Sorry, but saying “it does (not) work” is not something that tells much in a computer environment.
You should explain
what you did (and we have only some configurations, but you did not tell what you did);
what happened (this is missing complete);
what you expected to happen (this is also missing).
So we can only guess what you mean with “working”. And guessing from this side will probably lead to misunderstandings and bad advice.
Oh, and please select you pieces of computer text and then hit the </> button in the tool bar of the post editor. That will make the computer text much more readable and understandable.
I was expecting user root root can only login from 192.168.1.1. Well, logging in from another IP-address is possible also:
ssh 127.0.0.1 'whoami'
root
But Busy Penquin was right, it’s in the man 5 ssh_config:
…the following pattern list will fail: from=“!host1,!host2”
…
The solution here is to include a term that will yield a positive match,
such as a wildcard: from=“!host1,!host2,*”
Hence: this one also works:
DenyUsers root@!10.19.69.0/24,*
Logging in from localhost will now result into:
journalctl -l -u sshd.service
User root from 127.0.0.1 not allowed because listed in DenyUsers
And to make it all complete I changed the config to: