How to allow only specific users to login using SSH

To make your server secured when using SSH services, not every users need to be able to gain ssh service on your server. You can specify which user can connect to the server by changing the configuration file in server.

In your terminal, find this file:


For example, if you only allow user “michael” to connect to the server, add in the line below:

AllowUsers michael

Finally, save your setting. Done