Prevent users sign in via SSH

Linux, Ubuntu, 2015-06-16 23:05:03 UTC

By default, Linux bundled with SSH.

On a server with a Linux OS, may have had hundreds of users. By default, these users can log in via SSH.

Each user has different levels of knowledge of the security features on this Linux. Carelessness of a user can be bad to the server.

If an intruder sign in via SSH, this can be very dangerous. Can be ascertained, intruder can perform any activity with ease through this SSH.

In this tutorial I will explain how to prevent certain users in through SSH.

In general, ssh cofig stored in / etc / ssh / sshd_config

In order to prevent users from entering via SSH, type the following command;

$ sudo nano /etc/ssh/sshd_config

Add the following lines;

DenyUsers udin, jabua

If you want to add users who can log in via SSH, add the following line in the sshd_config;

AllowUsers uone, utwo

To make these changes work, restart SSH with the following command;

$ /etc/init.d/ssh restart