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 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@ root user1 user2