disable ssh for some users

Posted on 2004-11-29
Last Modified: 2010-04-20
I have Slackware 10. I need to use SSH only for some people and disable it to some other. What do I need to change?
right now works for every user.

Question by:joseggarza
    LVL 38

    Expert Comment


       If you don't want some people login to your system, then you can simply disable/delete their accounts.
    Or edit /etc/password and make their default shells to /bin/false.

    LVL 11

    Accepted Solution


    manpage of sshd_config

               This keyword can be followed by a list of user name patterns,
               separated by spaces.  Login is disallowed for user names that
               match one of the patterns.       `*' and `?' can be used as wildcards
               in the patterns.  Only user names are valid; a numerical user ID
               is not recognized.       By default, login is allowed for all users.
               If the pattern takes the form USER@HOST then USER and HOST are
               separately checked, restricting logins to particular users from
               particular hosts.

    wonder if this is what you wanted

    Author Comment

    Thanks A lot..... AllowUsers was my answer..... once you define AllowUsers the rest are denied by default.....
    Thanks a lot

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    How to Change Interface on Cisco IOU 11 62
    Cron jobs 12 64
    Linux SSH Error 9 53
    PHP Command Not Working in SSH 11 65
    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now