How To Install jailkit on Ubuntu 20.04
Introduction
In this tutorial we learn how to install jailkit
on Ubuntu 20.04.
What is jailkit
jailkit is:
Jailkit is a set of utilities to limit user accounts to specific files using chroot() and or specific commands. Setting up a chroot shell, a shell limited to some specific command or a daemon inside a chroot jail is a lot easier and can be automated using these utilities.
Jailkit is a specialized tool that is developed with a focus on security. It will abort in a secure way if the configuration, the system setup or the environment is not 100% secure, and it will send useful log messages that explain what is wrong to syslog.
Jailkit is known to be used in network security appliances from several leading IT security firms, Internet servers from several large enterprise organizations, Internet servers from Internet service providers, as well as many smaller companies and private users that need to secure login in services or in daemon processes.
Currently, Jailkit provide jails for cvs, git, scp sftp, ssh, rsync, procmail, openvpn, vnc, etc.
Jailkit make available the following commands: jk_check, jk_chrootlaunch, jk_chrootsh, jk_cp, jk_init, jk_jailuser, jk_list, jk_lsh, jk_socketd, jk_uchroot, jk_update.
There are three methods to install jailkit
on Ubuntu 20.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install jailkit Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install jailkit
using apt-get
by running the following command:
sudo apt-get -y install jailkit
Install jailkit Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install jailkit
using apt
by running the following command:
sudo apt -y install jailkit
Install jailkit Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install jailkit
using aptitude
by running the following command:
sudo aptitude -y install jailkit
How To Uninstall jailkit on Ubuntu 20.04
To uninstall only the jailkit
package we can use the following command:
sudo apt-get remove jailkit
Uninstall jailkit And Its Dependencies
To uninstall jailkit
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove jailkit
Remove jailkit Configurations and Data
To remove jailkit
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge jailkit
Remove jailkit configuration, data, and all of its dependencies
We can use the following command to remove jailkit
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge jailkit
References
Summary
In this tutorial we learn how to install jailkit
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.