If you would like to use
pam_access in redhat and centos and so on, first you need to include the module in your pam configura as follow.
authconfig --update --enablepamaccess
Now you can configure which users that can use your server.
my example rules
+ : DOMAIN\admins : ALL
+ : root : ALL
- : ALL : ALL
If you use
DOMAIN\ sintax in front of the users and groups, that would say you are using winbind, for AD join, I'm using pam_ldap with sfu in the windows side, for this reason in my comments I don't use the domain.
Now you have configured Pam for the users access control, but Now you need to be sure that sshd is using pam,
grep "UsePAM" /etc/ssh/sshd_config
UsePAM isn't yes, you need to change this to yes and restart sshd service