VirtFS Jailed Shell in cPanel & WHM

This article explains how VirtFS provides a secure jailed shell environment for SSH users in cPanel & WHM. It covers how VirtFS works, warnings and limitations, how to enable or disable jailed shells, how Exim interacts with VirtFS, and how to remove or clean up VirtFS mount points.

WHM shell accesscPanel SSH securityVirtFS jailed shell

~4 min read · Updated Feb 14, 2026

1. Overview


cPanel & WHM uses VirtFS to provide a jailed shell environment for users who connect via SSH. A jailed shell isolates the user inside a restricted filesystem container, preventing access to other users’ home directories and improving overall server security.


Users inside a jailed shell can run commands that are normally unavailable in restricted environments, such as crontab and passwd.


2. Important Warnings and Limitations


  • Mounting more than 4000 targets in Virtuozzo environments may cause performance or connection issues.
  • Servers with more than 500 accounts may experience issues if the experimental setting Jail Apache Virtual Hosts using mod_ruid2 is enabled.
  • On CloudLinux servers, enabling jailed shell may expose symlink vulnerabilities unless Link Traversal Protection is enabled.

3. The /home/virtfs/ Directory


Critical Warning: Never use rm to delete files or directories inside /home/virtfs/. Doing so will delete the real files on the system and can render the server unusable.


The directory /home/virtfs/ is created automatically the first time a user logs in via SSH or SFTP in jailed mode. It contains configuration files, utilities, and BIND mounts.


This directory does not consume real disk space, but some commands (like du) may incorrectly report usage.


3.1 Understanding BIND Mounts

BIND mounts create virtual links between filesystem locations. For example:


/home/virtfs/username/usr/bin → /usr/bin

The user sees /usr/bin but within a restricted environment.


Note: On CentOS 7, CloudLinux 7+, AlmaLinux, Rocky Linux, RHEL 7, and Ubuntu, additional system mount points exist. Do not unmount them.


4. Enabling a Jailed Shell Environment


4.1 Enable for All New or Modified Accounts

Use the following WHM setting:


WHM » Server Configuration » Tweak Settings


Enable Use cPanel jailshell by default.


This applies only to new accounts or accounts edited in:

  • Modify an Account
  • Upgrade/Downgrade an Account

4.2 Enable for a Specific User

Use:


WHM » Account Functions » Manage Shell Access


When enabled, the user’s shell becomes:


/usr/local/cpanel/bin/jailshell

5. Exim and VirtFS


If a user’s shell is jailshell or noshell, Exim executes alias and filter processes inside VirtFS. This provides additional security by isolating Exim operations.


6. CSF or LFD Alerts


After updates, you may see warnings like:


/bin/crontab: FAILED
/bin/passwd: FAILED

This is a false positive. These files are symlinks used to allow jailed shell access to system commands.


7. Disabling or Removing a Jailed Shell Environment


Warning: VirtFS cannot be fully removed. Even after disabling it, certain processes may recreate the jailed environment, including:

  • Exim filters
  • Piped email
  • Cron jobs
  • Jailed Apache virtual hosts

7.1 Disable Jailed Shell for One User

Use:


WHM » Account Functions » Manage Shell Access


7.2 Disable Jailed Shell for All Users

  • Disable Use cPanel jailshell by default in Tweak Settings.
  • Set all accounts to Disabled Shell in Manage Shell Access.

When disabled, the user’s shell becomes:


/usr/local/cpanel/bin/noshell

8. Removing a User’s VirtFS Environment


  • Disable jailed shell for the user.
  • Unmount the user’s VirtFS BIND mounts:

umount /home/virtfs/username/usr/bin

9. Clear Orphaned VirtFS Mounts


To remove leftover mount points:


/usr/local/cpanel/scripts/clear_orphaned_virtfs_mounts

9.1 Remove Mounts for One User

/usr/local/cpanel/scripts/clear_orphaned_virtfs_mounts --user=username

9.2 Remove All VirtFS Mounts

/usr/local/cpanel/scripts/clear_orphaned_virtfs_mounts --clearall

9.3 Check for VirtFS Mounts

grep -i username /proc/mounts

Conclusion


VirtFS provides a secure and isolated shell environment for SSH users in cPanel & WHM. Understanding how it works, how to enable or disable it, and how to clean up mount points ensures better server security and stability.


Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue