Results 1 to 2 of 2

Thread: File Extension Checker: Suspend Account?

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1
    cPanel/WHM Access Level

    Root Administrator

    Default File Extension Checker: Suspend Account?

    Hi,

    I have a shell script which searches through each user's /public_html/ folder every morning at 3am to find "illegal" files (file extensions include: .tor, .nfo, .bz2, etc). This works fine, but how can I make it so if an "illegal" file is found, the account is suspended?

    Thanks.

  2. #2
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default Re: File Extension Checker: Suspend Account?

    There are two ways of doing this.

    One is by executing /scripts/suspendacct $user $reason, this is not recommended but may be useful if it is a bash script.

    If you are writing this in perl or PHP, you can use the suspendacct xml-api call with one of the libraries hosted on our github:

    https://github.com/cpanelinc
    SuspendAccount < SoftwareDevelopmentKit < TWiki

    and just ensure a /root/.accesshash file exists so that credentials can be loaded.


    I will state that you may want to be careful with some of those file extensions, .bz2 concerns me as there are some legitimate reasons to have a bz2 file extensions (alot of open source code is hosted in .bz2) as it is one of the better open-source compression algorithms.
    Matt Dees

Similar Threads

  1. suspendacct to suspend account, what command to suspend reseller?
    By sodapopinski in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 04-06-2009, 10:06 AM
  2. Handle a file without extension
    By dpozitif in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 08-10-2008, 05:01 PM
  3. How to restrict file extension upload?
    By netkelly in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 01-24-2005, 08:32 AM
  4. Suspend account .htaccess file
    By ntwaddel in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 12-04-2004, 03:55 AM
  5. zone file extension
    By Ibanez in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 05-12-2003, 10:25 PM