OpenSSH (que estou assumindo é o que você está usando) tem uma opção AllowUsers
:
AllowUsers - This keyword can be followed by a list of user name patterns, separated by spaces. If specified, login is allowed only for user names that match one of the patterns. Only user names are valid; a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USER@HOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts. The allow/deny directives are processed in the following order:
DenyUsers
,AllowUsers
,DenyGroups
, and finallyAllowGroups
.
Edite o arquivo /etc/ssh/sshd_config
e inclua na parte inferior dele:
AllowUsers git [email protected].* [email protected].* [email protected].* [email protected].*
Se isso não funcionar (e desta forma, pode ser realmente mais limpo) você pode usar a opção Match
junto com AllowUsers
:
# This is the default setting (only allow GIT access)
AllowUsers git
# This is the setting that is ONLY available if you are SSHing from the LAN (allow the listed users)
Match Address 192.168.0.*
AllowUsers git adam bob cliff dave