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.

JailShell / Shell issues

Discussion in 'General Discussion' started by hostserve, Jul 9, 2007.

  1. hostserve

    hostserve Well-Known Member

    Joined:
    Aug 25, 2006
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Good morning,

    I am not sure if this issue is something cpanel can help me with or not... I'm not sure who's control or management it falls under.

    Ok... SO i have a user on the weekend that needed to have php5 installed. We had our weekend outsourced tech support install it and then there were isssues due to virtual file systems or something (their e-mail is below):

    ----- start support e-mail

    > ----- Original Message -----
    > From: Technical Support
    > To:
    > Sent: Sun Jul 08 09:31:21 2007
    > Subject: New Note - [!92675]: PHP 5?
    >
    > Ticket Note: PHP 5?
    >
    > Dear Admin,
    >
    > A user, '[username]' with jailshell wants to execute php5 file in the konsole.
    > A jailshell user don't have the privilege to access the binary of
    > PHP5, /usr/local/php5/bin/php5.
    >
    > It will throw an error like this:
    > ========
    > [username]@cp2 [~/public_html/wikilivres/mediawiki-1.10.0/maintenance]#
    > /usr/local/php5/bin/php5 test.php -jailshell:
    > /usr/local/php5/bin/php5: No such file or directory
    =======
    >
    > If his shell is changed to bash, he will be able to run
    > /usr/local/php5/bin/php5. So please let us know whether we can change
    > his shell to bash.

    Response from Tech Support:

    The issue is fixed now by an alternate solution.

    Jailshell is a very limited shell that allows clients to logon to server via SSH. It limits them to their home directories, keeping the rest of your files on your server from being viewed.

    When such a user login to server, /home/virtfs/[username] is considered as his / folder.

    So when he access /usr/local/php5/bin/php5 actually the binary "/home/virtfs/[username]/usr/local/php5/bin/php5 " will be accessed.

    As php5 is not installed as default, we copied all the necessary binaries of
    php5 to /home/virtfs/[username]/usr/local/php5 .

    And now it is working fine.
    ===============
    [username]@[username]
    [~/public_html/wikilivres/mediawiki-1.10.0/maintenance]# /usr/local/php5/bin/php5 update.php
    X-Powered-By: PHP/5.2.2
    Content-type: text/html
    ================

    ----- end support e-mail

    as a result of this problem / fix, the user can apparently use cpanel and php5 however I can not login to the server as root.... when I login with the password it tells me I have new mail and then it boots me back to a login prompt, but this only works from the console. Logging in from ssh does not work.... it says the username or password is wrong.

    I can however login to WHM...

    Any suggestions or ideas ?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That suggests that the person installing php may have screwed up /usr/local since the virtfs system is a bunch of hardlinks to the real OS, it's entirely possible that someone inadvertently broke something - you should never mess with virtfs for this reason.

    You're probably only going to get in by rebooting the server into single user mode and repairing whatever damage was caused. If that doesn't work, then you're looking at either attempting a repair after booting from a linux recovery CD or a complete OS restore and restore cPanel data from backup or recovering by mounting the old OS disk as a slave and migrating the data to a new OS disk. This covers most of that:
    http://forums.theplanet.com/index.php?showtopic=38797
     
  3. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Why would you even risk any type of shell, let alone have a 3rd party admin determine your fate? Do yourself a favor and be rid of any type of customer shell you may have configured. Otherwise, one day soon it looks like, you may be meeting your new root administrator / customer.

    good luck
     
  4. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    i had my share with virtfs once. never and i mean NEVER modify it, the solution will go with os reinstall that is my 2 cents, but i never took something IN virtfs, so i don't know if this can be fixed by removing the php stuff which the tech put there.

    anyway what the tech did was a LOGICAL thing to do: it's not there, put it.

    you don't have by any chance chirpy's CSE installed right ?

    if not, try booting the box in single, remove the php stuff that the tech added to the specific virtfs folder, reboot, and see if works.

    again this solution is LOGICAL, and on the fly, take out what has been put in.

    hopefully you will do fine with no os reload whatsoever.
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    As a professional security consultant, I would agree with Jay said above about
    not allowing any kind of shell access on your server.

    Even jailshell provides for a multitude of security risks in itself and is
    far to easy to escalate privileges to a non-restrictive shell.

    Now as for having a 3rd party administrator, I don't see any problem with that
    in and of itself as there are a number of good management companies and
    administrative professionals out there but then at the same time, there
    are even more who dangerously tout themselves providing management
    services without the proper qualifications or experience. I cannot speak
    for your current tech since I do know them but with the information given
    in this thread alone, I'm can at least say that I am not impressed.
     
  6. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    My wording was a bit off perhaps in haste and the bad feeling of the original post as a whole. I am a 3rd party admin myself and by all means not advising against such service providers. My original meaning was meant to comment on this isolated incident and not 3rd party administration in its entirety.

    Cheers!
     
Loading...

Share This Page