Blog

Add a command/binary to CageFS

Tags: binaryCageFSCloudLinuxLinuxrpm

Published on: March 29, 2017 by Manu M.

Add a command/binary to CageFS

Scenario:

Hello Pals,

My new blog is about adding a command or binary in the CageFS. For those who doesn’t know what CageFS is, I will start with a small brief on that.

CageFS

CageFS is a term related to CloudLinux and it is a virtualized file system and a set of tools to contain each user in its own ‘cage’ (can relate to chroot in Linux). Each customer will have its own fully functional CageFS, with all the system files, tools, etc.

So coming back to the topic, I will be adding FTP command to the CageFS.

First, we can check the binary ‘FTP’ and see if it’s present in the server.

root@myserver [~]# ftp
ftp>

Now that command is available on the server let’s see after switching to a normal user.

root@myserver [~]# su - manu
 
 
manu@myserver [~]# ftp
-bash: ftp: command not found

So its confirmed that the command “ftp” is not available to the users. Now we are going to add this to CageFS so that the command becomes available to users.

You can add any RPM’s if they’re installed on the server. First, find the full path of the command using the ‘which’ command:

root@myserver [~]# which ftp
/usr/bin/ftp

Once you have the full path, find out its package.

root@myserver [~]# rpm -qf /usr/bin/ftp
ftp-0.17-54.el6.x86_64

Now let’s add the package/rpm to CageFS

root@myserver [~]# cagefsctl --addrpm ftp-0.17-54.el6.x86_64

You need to update CageFS so that its added to every user’s cage.

root@myserver [~]# cagefsctl --force-update

Once the command is executed, switch to a user’s account and verify that command is available.


root@myserver [~]# su - manu
 
manu@myserver [~]# ftp
ftp>

That’s all and the command ftp will be available for the user now.

Hope this blog was helpful. 🙂

Get 24/7 expert server management

Category : Apache, Howtos, Linux

Manu M.

Manu M.

Manu has been with us for past one and half years and is a person with good technical skills and domain knowledge. Being a highly athletic personality, Manu likes to play Cricket and Badminton of all games whenever he gets time off. Apart from his technical and athletic abilities, he is a good writer and has tried his hands on penning a few poems of his own. He believes in the mantra that "small things matter the most" and this nature can also visible in his blogs and writings.

You may also read:

Comments

Add new commentSIGN IN

Let's Connect

Categories

Your Cart

Cart is empty.

Subtotal
₹0.00
APPLY
0
Send this to a friend