To prevent users from ssh’ing to your server, you can use the sshd_config file to restrict access.
One approach is to deny specific users. You can achieve this by adding the following line to your /etc/ssh/sshd_config file:
DenyUsers usera userb userc
You will then need to reload or restart sshd for the change to take effect.
service sshd
