The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disabling SSH Access For All Users

Discussion in 'General Discussion' started by Dathorn_ADT, Mar 25, 2004.

  1. Dathorn_ADT

    Dathorn_ADT Active Member

    Joined:
    Nov 16, 2002
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Does anyone have an easy way to disable SSH access for all users that currently have it enabled whether it be regular SSH or jailed SSH? Changing them individually via "Manage Shell Access" is a bit ridiculous when your talking about thousands of accounts.
     
  2. henker

    henker Well-Known Member

    Joined:
    May 1, 2003
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    You can edit /etc/ssh/sshd_config,

    AllowUsers username
     
  3. HelloAdam

    HelloAdam Well-Known Member

    Joined:
    Nov 6, 2005
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Hey,

    Does anyone have a solution? IE like disable SSH access for all users via a cPanel script or something?


    Thanks,
    Adam
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try:

    Code:
    for i in `ls -A /var/cpanel/users`; do usermod -s /usr/local/cpanel/bin/noshell $i; done
    I haven't tested this, so proceed at your own risk.

    Basically this should find a list of all your cpanel users from /var/cpanel/users and then change the shell for all users to /usr/local/cpanel/bin/noshell. It should work, but again, I haven't tested it.
     
Loading...

Share This Page