Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    158
    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:
    231
    Location:
    Ireland
    cPanel Access Level:
    Root Administrator
    You can edit /etc/ssh/sshd_config,

    AllowUsers username
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. HelloAdam

    HelloAdam Well-Known Member

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

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


    Thanks,
    Adam
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,659
    Likes Received:
    76
    Trophy Points:
    328
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice