Deny ssh access to one user

18 05 2017

If you want to deny the access of one user (or group) to a server via ssh, these are the steps for a Debian/Ubuntu server:

Add the user to /etc/security/access.conf
- : user1 : ALL

Assure that “/etc/ssh/sshd_config” have the following line (by default yes):
UsePAM yes

Assure that “/etc/pam.d/sshd” have uncommented the following line:
account required