Information
There are several options available to regulate access to a server via OpenSSH. At least of the following options needs to be leveraged:
AllowUsers: The AllowUsers variable specifies which users may ssh into the system. The list is user names separated by spaces. Numeric userIDs are not recognized with this variable. Access can be narrowed to restrict user access from a specific host using the form user@host.
AllowGroups: The AllowGroups variable specifies groups of users who are permitted to ssh into the system. The list is group names separated by spaces. Numeric groupIDs are not recognized with this variable.
DenyUsers: The DenyUsers variable specifies specific users who may not ssh into the system. The list is user names separated by spaces. Numeric userIDs are not recognized with this variable. Access can be narrowed to restrict user access from a specific host using the form user@host.
DenyGroups: The DenyGroups variable specifies groups of users who are not permitted to ssh into the system. The list is group names separated by spaces. Numeric groupIDs are not recognized with this variable.
Rationale:
Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system.
Solution
Edit the /etc/ssh/sshd_config file to set one (or more) of the following parameters:
AllowUsers <userlist>
AllowGroups <grouplist>
DenyUsers <userlist>
DenyGroups <grouplist>
Re-cycle the sshd daemon to pick up the configuration changes:
stopsrc -s sshd
startsrc -s sshd
Default Value:
All users from any host are permitted.