blocking ssh for a particular user

Discussion in 'Suggest HOWTO' started by jithesh, May 4, 2006.

  1. jithesh

    jithesh New Member

    can any one tell me how to block a particular users ssh login.But when he logs in locally it should happen.
    thank you
     
  2. falko

    falko Super Moderator Howtoforge Staff

    If the user has a static IP address, you can add

    Code:
    sshd: 12.34.56.78
    to /etc/hosts.deny. Replace 12.34.56.78 with the user's static IP address.
     
  3. santhanamt

    santhanamt New Member

    Blocking, Allowing users for SSH




    vim /etc/ssh/sshd_config

    # To allow only certain users >> Allows only user1 and user2 to login via SSH

    AllowUsers user1 user2 user3

    # To block certain users >> Blocks only user5 and user6

    DenyUsers user5 user6


     
  4. topdog

    topdog Active Member

    You can use allowed group as well, that way you just add users to the group.

    Code:
    AllowGroups <group_name>
     
    Last edited: Mar 26, 2009

Share This Page