CentOS/RHEL 7 allows nested configuration in " /etc/ssh/sshd_config ". The following is an example :

sudo nano /etc/ssh/sshd_config

Add the following line :

AllowUsers user1

The following example demonstrates that the user “testuser” can be logged in from 10.0.0.1 only, and the rest of the listed users can login from any host. Note that you need to list all the users who can be allowed to login, which is the downside of not supporting nested configuration.

AllowUsers testuser@10.0.0.1 root user1 user2