Open the file ‘/etc/ssh/sshd_config’ and add the parameter ‘AllowUsers user1 user2′ & then restart the ssh server.