How to block specific username from ssh?
Put DenyUsers user1 user2 user3
in /etc/ssh/sshd_config
Artyom answer is correct. I'd just like to point that there is also the possibility to opt for a 'white-list' approach instead of the 'black-list' one by putting a line like this in /etc/ssh/sshd_config:
AllowUsers AuthorizedUser1 AuthorizedUser2
and reloading ssh service (service ssh restart
)
Then every other user will be denied ssh access (be careful not to lock yourself out ;-) )