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.

Disable shell access for all users

Discussion in 'General Discussion' started by kcdworks, Aug 15, 2003.

  1. kcdworks

    kcdworks Well-Known Member

    Joined:
    Jul 28, 2002
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    Is there a quick way to disable shell access for all users? We just purchased a very small hosting company (one server) with several hundred domains, and ALL of them have shell access.

    I'm going through WHM to disable shell access for everyone, but is there an easier way?

    cPanel.net Support Ticket Number:
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Create file.sh anywhere with the following contents:
    Code:
    #!/bin/sh
    
    cd /var/cpanel/users/
    for file in *
    do
    chsh -s /usr/local/cpanel/bin/noshell $file
    done
    Then execute it as root: sh file.sh

    cPanel.net Support Ticket Number:
     
  3. kcdworks

    kcdworks Well-Known Member

    Joined:
    Jul 28, 2002
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    Thanks much. :)

    cPanel.net Support Ticket Number:
     
  4. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    You may want to tack an

    exit

    onto the end of the script, but it will work well regardless. Good luck.

    cPanel.net Support Ticket Number:
     
  5. Michael-MS

    Michael-MS Well-Known Member

    Joined:
    Apr 16, 2003
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    awesome, thanks!
     
Loading...

Share This Page