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.

jailed shell bug?

Discussion in 'General Discussion' started by manokiss, Dec 19, 2003.

  1. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    cPanel uses virtfs for its shell jailing. Virtfs is a system which creates a
    virtual filesystem in which a user is restricted to which simulates a real
    fully functional system within the server.

    When cPanel creates the jail shell environment for a user, it creates a
    directory in /home/virtfs/ with the name of the username, similar to the
    entry in /home/. In this directory, cPanel places files that creates the
    environment of the jailed shell, as well as copies the user's files in
    /home/virtfs/<user>/home/ in a directory of the username, essentially
    emulating the real environment without the rest of the users.

    The problem with this is cPanel is copying the files, so the user has
    duplicate files, and quota usage doubles. What should happen instead is
    cPanel moving to full virtfs support where /home/<user>/home/<user>/ becomes
    the site root so virtfs files can be placed in /home/<user>/, or there
    should be a symlink created to the user's files from
    /home/virtfs/<user>/home/<user>/ pointing to /home/<user>/.

    This is not only a problem with user quotas, but also with disk usage. A
    server which has multiple large sites with jail shell access could consume
    the entire hard drive fairly quickly.


    Beau Steward
    Systems Engineer
     
  2. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Incorrect. It does not duplicate the user's home directory. It simply configures a placeholder that virtfs references.

    Quotas are not doubled. Run a scan of disk usage on the user's actual home directory and then check their quota. They will be roughly the same.
     
  3. lyndon

    lyndon Registered

    Joined:
    Sep 2, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I have a problem at the moment similar to this. A 'du -h' in my home directory shows I've used 217 mb, but CPanel thinks I've used 433mb!!! My hosting provider seem inept at resolving this issue, and at the moment I'm loosing emails because it thinks I've exceeded my quota (300mb). Grrr.

    Lyndon
     
  4. cPanelBilly

    cPanelBilly Guest

    when /scripts/fixquotas run it updates the quotas, any user that is logged in with jailsheel is immediatly logged out and told not to log back in for 30min to prevent this from happening.
     
  5. GTFO

    GTFO Active Member

    Joined:
    Aug 8, 2005
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hey billy, how does one go about purging this /home/virtfs directory safely? Someone suggested disabling and enabling jailshell in WHM, would this work ?

    Also, in regards to that other users problem whose host thinks he's exceeded quota : I notice that these files are owned root.user . I don't have this problem as of yet, but i've definitely seen this as a problem where a file is owned by the user outside their account and is added up in their quota. Will this be a problem or will the "root" owner prevent that ?
     
  6. GTFO

    GTFO Active Member

    Joined:
    Aug 8, 2005
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    ....nm.. I think I understand now... a bunch of links.. not actual space, just the combined total of their linked directory... Quotas thing makes sense too... i've not had that problem yet, but better to know beforehand.
     
Loading...

Share This Page