Skip to main content

How to disable jailshell completely and get rid of virtfs folder

Comments

15 comments

  • ThinIce
    I'm sure one of the cPanel chaps will be along soon, but I'm relatively sure that you can't disable it these days, things like user cron are run in the jail now. [url=http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/VirtFS#How%20to%20remove%20_VirtFS]VirtFS (Jailed Shell) [Quote] PICK Important: In cPanel & WHM Version 11.38, updates to the jailed shell system were added to improve security. As a result, it is not possible to completely remove the jailed shell system. ALERT! Warning: The directions below will remove a jailed shell, but cannot prevent the recreation of the jailed environment. Examples of processes that recreate the jailed environment include: Exim processing filters Piped e-mail addresses Cron tasks Jailed Apache Virtual Hosts that use mod_ruid2 via the applicable Tweak Setting option.
    0
  • cPanelMichael
    Hello :) You would have to grant full shell access to the account in order to prevent the account from using a jailed shell environment for things like cron jobs or Exim filters. However, to note, I believe you are not interpreting the disk space it uses correctly. A bind mount is a transparent link between two places on the file system. For example, if a user views the contents of /home/virtfs/username/usr/bin, the user actually sees the contents of /usr/bin. Thus, the /home/virtfs/$user directory itself is not actually using up any additional space than already exists. Data is not actually duplicated. Thank you.
    0
  • Kent Brockman
    Hello Michael. Ok, so, that's why before u-mounting, the disk space used by virtfs was 10 GB, and now is barely 3 MB, and although the free disk space reported in System Health "Show Current Disk Usage is the same before and after, that's because of hard links? Nevertheless, I NEVER give shell access to no customer, but virtfs is showing two of them, with no shell access granted. This may happened why? if they set a crontask? I have lots of users here and in the other VPS using cron tasks and not being pushed into virtfs. Exim processing filters? I do use filters in other servers and virtfs is empty, zero bytes long. Jailed shell? mod_ruid2? We don't use that, now nor never before. Since it's a small shared hosting, I don't feel like users connecting via SSH, ever. Piped e-mail addresses? if you mean email redirection piped to any system command, never used that. So, I guess I have to live with that, and those folders using 3 MB turn out to be the best scenario I can hope? What if I delete the 2 accounts and then recreate it from a fresh backup? That won't delete the user's folders inside virtfs?
    0
  • cPanelMichael
    [quote="Kent Brockman, post: 1556022">Ok, so, that's why before u-mounting, the disk space used by virtfs was 10 GB, and now is barely 3 MB, and although the free disk space reported in System Health "Show Current Disk Usage is the same before and after, that's because of hard links?
    No, the disk space you are seeing is not actually used in the virtfs directory. You are actually seeing the disk space used by the directories linked to. When you umounted the virtfs directory it removed those links, so that's why you see less space reported. [quote="Kent Brockman, post: 1556022">Nevertheless, I NEVER give shell access to no customer, but virtfs is showing two of them, with no shell access granted. This may happened why? if they set a crontask? I have lots of users here and in the other VPS using cron tasks and not being pushed into virtfs.
    I believe you are unnecessarily viewing the virtfs directory with a negative connotation due the incorrect assumption that it's taking up more disk space. It's not actually utilizing additional space, it just seems that way due to how the links to other directories are utilized. Check the sections related to cPanel 11.38 and 11.40 on the following document to get a better idea of why virtfs is utilized for accounts. [url=http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/VirtFS]VirtFS (Jailed Shell) It's by design that it's utilized with jailed shell or no shell. It's setup this way to increase security. Thank you.
    0
  • Kent Brockman
    Yes, I did readed that doc. I now understand the hardlink thing. What I dont understand and puzzles me it's why I'm not seeing such folders and "virtual" usage in my other VPS. All of them have the same OS and cPanel versions...
    0
  • Kent Brockman
    Now I see, there is a cron task set for that account and everytime it runs, the virtfs is mounted. The thing I dont understand, and I think it could be weird/bad/incorrect, is that the main disk mount point was permanently set to be /home/virtfs/*username*/home/*username*
    In other VPS I see that is set to "/" Can you explain why this happens and if it is expected to be so?
    0
  • cPanelMichael
    [quote="Kent Brockman, post: 1556211">The thing I dont understand, and I think it could be weird/bad/incorrect, is that the main disk mount point was permanently set to be /home/virtfs/*username*/home/*username*

    Could you elaborate on this? For instance, what do you mean by the main disk mount point? Thank you.
    0
  • Kent Brockman
    Maybe I named incorrectly. No I fixed it by unmounting and deleting the cron tasks, as they belong to an old account of mine. Below, where you now see Mount Point = "/", before u-mounting the virtfs folders, it used to say "/home/virtfs/*username*/home/*username*"
    0
  • cPanelMichael
    [quote="Kent Brockman, post: 1556282">Below, where you now see Mount Point = "/", before u-mounting the virtfs folders, it used to say "/home/virtfs/*username*/home/*username*"
    0
  • Kent Brockman
    Thank you Michael, I'll keep an eye on this.
    0
  • crazyaboutlinux
    [quote="Kent Brockman, post: 1556612">Thank you Michael, I'll keep an eye on this.
    An Important Thread. really needs to be subscribed.
    0
  • cPanelMichael
    [quote="crazyaboutlinux, post: 1742062">An Important Thread. really needs to be subscribed.
    Are you experiencing a similar issue? This thread was opened in January so it's not likely to receive additional input from the user at this point in time. Thank you.
    0
  • Arec Johnson
    I've also the same question and looking for the right solution. But thanks for sharing the updated guide link it clears my query on how to disable or remove jail shell environment:
    0
  • cPRex Jurassic Moderator
    @Arec Johnson - does the documentation answer your questions now that you've had a chance to check it out?
    0

Please sign in to leave a comment.