unix

How do I prevent specific users from ssh’ing to my server?

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

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top