Results 1 to 10 of 10

Thread: Enable shell_exec() for one user!?

  1. #1
    Member parisdns's Avatar
    Join Date
    Aug 2004
    Location
    PrivateLayer.com
    Posts
    42

    Question Enable shell_exec() for one user!?

    How could I enable shell_exec() only for one user? Thanks.
    www.ShoutSonic.com ~ come and shout on gigE public networks
    ichiDESK.com | unmetered Dedicated Servers ON DEMAND from US & EU on 10Mbps/100Mbps/1Gbps !
    www.sanBOX.in ~ Storage Area Network Dedicated Servers
    We also do Linux & Windows Web Hosting

    Are you TotemOrTaboo.com ?

  2. #2
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    Default

    i wait the replay

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Oct 2008
    Posts
    49

    Default

    Hi;

    It is only possible if you have installed suhosin extentions in your server.

    Below are the exact steps to enable a particular PHP function:

    1. Remove all functions from disable_functions in php.ini
    2. Add functions in php.ini suhosin.executor.func.blacklist = “” those you want to disable globally.

    After that in the virtual host section of a domain you can add below code to enable a function only for one domain:

    <VirtualHost 127.0.0.1>
    ………..
    <IfModule mod_php5.c>
    php_admin_value suhosin.executor.func.blacklist = “shell_exec”
    </IfModule>
    ……
    </VirtualHost>

    In this example shell_exec has been enabled for the VirtualHost.
    JaguarPC
    jaguarpc.com

  4. #4
    Member
    Join Date
    Apr 2009
    Location
    United States
    Posts
    153
    cPanel/WHM Access Level

    Root Administrator

    Default

    I changed this in httpd.conf:
    <VirtualHost 174.136.1.201:80>
    <IfModule mod_php5.c>
    php_admin_value suhosin.executor.func.blacklist = “shell_exec”
    </IfModule>
    ServerName resellertag.com
    ServerAlias Reseller Tag :: Essential Reseller Solutions
    DocumentRoot /home/username/public_html
    ServerAdmin webmaster@resellertag.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/resellertag.com combined
    CustomLog /usr/local/apache/domlogs/resellertag.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User username # Needed for Cpanel::ApacheConf
    UserDir disabled
    UserDir enabled username
    <IfModule mod_suphp.c>
    suPHP_UserGroup username username
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    SuexecUserGroup username username
    </IfModule>
    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/username/resellertag.com/*.conf"

    </VirtualHost>

    I restarted httpd and it gave me an error.

    I have suhosin installed on my server too.

    suhosin.executor.func.blacklist = "" is not in php.ini but I added it with the functions and I removed all the functions from disable_functions as well.

    What do I do?

  5. #5
    Member
    Join Date
    Sep 2007
    Posts
    29

    Default

    Quote Originally Posted by rlshosting View Post
    I changed this in httpd.conf:
    <VirtualHost 174.136.1.201:80>
    <IfModule mod_php5.c>
    php_admin_value suhosin.executor.func.blacklist = “shell_exec”
    </IfModule>
    ServerName resellertag.com
    ServerAlias Reseller Tag :: Essential Reseller Solutions
    DocumentRoot /home/username/public_html
    ServerAdmin webmaster@resellertag.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/resellertag.com combined
    CustomLog /usr/local/apache/domlogs/resellertag.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User username # Needed for Cpanel::ApacheConf
    UserDir disabled
    UserDir enabled username
    <IfModule mod_suphp.c>
    suPHP_UserGroup username username
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    SuexecUserGroup username username
    </IfModule>
    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/username/resellertag.com/*.conf"

    </VirtualHost>

    I restarted httpd and it gave me an error.

    I have suhosin installed on my server too.

    suhosin.executor.func.blacklist = "" is not in php.ini but I added it with the functions and I removed all the functions from disable_functions as well.

    What do I do?
    I've same problem shell_exec disable, How to resolved them ?

  6. #6
    Member
    Join Date
    Apr 2009
    Location
    United States
    Posts
    153
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Enable shell_exec() for one user!?

    Found a better explanation and it even worked for me this time!

    How to Enable shell_exec function for one account? - Accu Web Hosting

  7. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Enable shell_exec() for one user!?

    If you are using DSO, then you can use the method for suhosin, but this will not work under suPHP unfortunately. It's always best to indicate the PHP handler when asking how to enable a function, so we know which one is being used.

    Also, the how-to indicated will not work to retain changes under cPanel, since cPanel has this line above each VirtualHost entry:

    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
    The reason it indicates not to edit directly is that every time either /scripts/rebuildhttpdconf or EasyApache runs, the changes made directly to httpd.conf in the VirtualHost area will be wiped.

    I have a discussion at the following url on how to get this working using DSO (and I link to my other guide in that post on how to get it working under suPHP):

    Is proc_open safe? - cPanel Forums
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    Member
    Join Date
    Apr 2009
    Location
    United States
    Posts
    153
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Enable shell_exec() for one user!?

    I don't know what you are talking about. It works fine for me under suphp(not using dso) and I haven't had a problem yet after rebuilding httpd.

  9. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Enable shell_exec() for one user!?

    These values (php_admin_value) cannot be passed for suPHP:

    <IfModule mod_php5.c>
    php_admin_value suhosin.executor.func.blacklist = “shell_exec”
    </IfModule>

    This is a DSO flag and should not work for suPHP:

    suPHP - FAQ

    suhosin + suphp - DirectAdmin Forums
    How to Enable PHP function for a one account ? | Linux Windows System Administrator Help
    How to Enable PHP function for a one account ? | backup recovery

    Just to name a few.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  10. #10
    Member
    Join Date
    Apr 2009
    Location
    United States
    Posts
    153
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Enable shell_exec() for one user!?

    Well, It works.

    Option Configured Value
    Default PHP Version (.php files) 5
    PHP 5 Handler suphp
    PHP 4 Handler none

    Apache suEXEC on

    I have shell_exec enabled on one account showing status2k without errors and the other account says: Warning: shell_exec() has been disabled for security reasons in /home/user/public_html/test/index.php on line 1
    Status 2k:
    Status2K Support

    SuPHP is Enabled.

Similar Threads

  1. What i must enable for user preview?
    By ASTRAPI in forum Security
    Replies: 3
    Last Post: 05-28-2009, 08:15 PM
  2. enable open_basedir for one user
    By asmithjr in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 11-29-2007, 12:58 PM
  3. how to enable shell_exec() for user using .htaccess
    By SACHIN in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 01-12-2007, 08:44 AM
  4. enable viewing /~user directories?
    By mattlindi in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 09-30-2006, 10:13 AM
  5. enable nobody user
    By avio in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 01-28-2004, 11:34 AM