Remove virtfs and Disable for users

VirtFS

VirtFS provides a jailed shell environment for users who connect to a server via SSH. The jailed shell acts as a container for the user, and does not allow the user to access other users’ home directories on the server. Unlike a normal shell environment, a jailed shell environment prevents access to data outside of the user’s home directory.

Consuming lot of disk space ?

Most of server got large disk space due to this virtfs. You can Disable VirtFS,Remove VirtFS and Unmount the bind mounts. CPanel provides a script to remove the virtfs mounts. Remove virtfs and Disable for users in your cpanel server

Do not delete /home/virtfs/username folder directly because its hard link with user account.

To disable VirtFS, system administrators can disable jailed shell access through WHM’s Tweak Settings interface (Home >> Server Configuration >> Tweak Settings) and Manage Shell Access interface for that cpanel user account WHM >> Account Functions >> Manage Shell Access.

Then use the following commands whether its still available.
# grep username /etc/passwd
If it does, you’ll need to change it to Bash or any other shell.

# crontab -l -u username
If you notice SHELL=”/usr/local/cpanel/bin/jailshell” in the output, you’ll need to edit user’s crontab and delete that line.

#w | grep -i username
If it is, you should inform him to log out or, if you feel like it, you can log him out by yourself.
You can unmount all active VirtFS mounts
#/scripts/clear_orphaned_virtfs_mounts –clearall
You can verify mount point for particular account

#grep -i username /proc/mounts
you will some thing like this

[email protected]cat /proc/mounts | grep username
/dev/xvda1 /home/virtfs/username/lib ext3 ro,nosuid,relatime,errors=continue,user_xattr,acl,barrier=0,data=ordered,jqfmt=vfsv0,usrjquota=quota.user 0 0
/dev/xvda1 /home/virtfs/username/bin ext3 ro,nosuid,relatime,errors=continue,user_xattr,acl,barrier=0,data=ordered,jqfmt=vfsv0,usrjquota=quota.user 0 0
/dev/loop0 /home/virtfs/username/var/tmp ext3 rw,nosuid,noexec,relatime,errors=continue,barrier=1,data=ordered 0 0
devtmpfs /home/virtfs/username/dev devtmpfs rw,nosuid,noexec,relatime,size=1002360k,nr_inodes=250590,mode=755 0 0
/dev/xvda1 /home/virtfs/username/usr/sbin ext3 ro,relatime,errors=continue,user_xattr,acl,barrier=0,data=ordered,jqfmt=vfsv0,usrjquota=quota.user 0 0
/dev/xvda1 /home/virtfs/username/home/username ext3 rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered,jqfmt=vfsv0,usrjquota=quota.user 0 0

then you should unmount and then remove it

#/scripts/clear_orphaned_virtfs_mounts

#for i in `cat /proc/mounts | grep /home/virtfs | cut -d ‘ ‘ -f 2 ` ; do umount $i ; done

That’s all!!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

cPHulk Brute Force Protection

WHM/cPanel has a service, protected from Brute Force attack, which is called “cPHulk Brute Force...

Enable SSH key authorized login without root password

You need to generate SSH Key ( the private key )on your cpanel server and then update remote...

How can I Redirect URLs in cPanel

Login your cpanel 1. Click the Redirects button on the front page under the “domains” 2. Enter...

Enable Custom php.ini for Fast CGI

With fast-cgi, custom php.ini needs to be in the cgi-bin folder. 1) Move php.ini to cgi-bin...

ConfigServer Firewall CSF installation

ConfigServer firewall is a popular linux firewall security suite. It is easy to install, flexible...

Powered by WHMCompleteSolution