Search code examples
unixconfigswapsshd

Unix : DenyUsers command NOT working on SSH


I would like to block some users from ssh login. I logged in as root and used Vi editor for making changes in sshd_config. Command is : " vi /etc/ssh/sshd_config " I added " #DenyUsers user1 " to the sshd_config and then restarted ssh. However i still can login to ssh with user1. How can i block it? Do i have to show you the sshd_config parameters? Thanks!


Solution

  • Quoting what you added:

    #DenyUsers user1
    

    Lines beginning with a # would be treated as comments. In other words, those would be ignored.

    You need to add

    DenyUsers user1
    

    (without the little # at the beginning of the line)