Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    40
    cPanel/Enkompass Access Level

    Root Administrator

    Default Disabling SSH Access For All Users

    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. #2
    Member henker's Avatar
    Join Date
    May 2003
    Posts
    60

    Default

    You can edit /etc/ssh/sshd_config,

    AllowUsers username

  3. #3
    Member
    Join Date
    Nov 2005
    Posts
    147

    Default

    Hey,

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


    Thanks,
    Adam
    cPanel Customer since November 2005
    ---
    - 7 Servers running cPanel/WHM

    Tutorials I have made:
    - Transfer accounts from one server to another

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default

    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.

Similar Threads & Tags
Similar threads

  1. Disable SSH/Shell Access for all users
    By MH-Andy in forum Security
    Replies: 7
    Last Post: 10-12-2010, 10:27 PM
  2. SSH access via Public Key Auth for cPanel users - How?
    By jols in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-28-2008, 03:58 AM
  3. Problem All Ssh users have access to cpanel
    By Neronix in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-02-2006, 08:20 AM
  4. ssh - user access to another users files
    By ladydi711 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-11-2006, 11:13 AM
  5. Disabling ssh access for root and allowing "su"
    By billau in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-17-2004, 04:54 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube