Jailkit and jailedShell restricted shell (JailedShell) are a type of restricted shell. It looks like a real Shell, but it does not allow you to view and modify any part of the real file system. The file system in Shell is different from the underlying file system. This function is implemented through chroot and other programs. For example, you can create a linuxshell for users to play with them or run a Jailkit and jailed Shell in a limited environment.
Restricted shell (Jailed Shell) is a type of restricted shell. It looks like a real Shell, but it cannot view or modify any part of a real file system. The file system in Shell is different from the underlying file system. This function is implemented through chroot and other programs. For example, you can create a linux shell for users to "play", or run all the functions of some programs in a limited environment.
In this tutorial, we will discuss how to use jailkit to create a restricted shell in Ubuntu. Jailkit is a tool that allows you to quickly create a restricted shell, put Restricted Users in it, and configure the programs to run in the restricted environment.
Jailkit download from here: http://olivier.sessink.nl/jailkit/
Install jailkit on Ubuntu/Debian
Because jaikit needs to be compiled on the system, first we need tools for compilation. Therefore, install the following package:
$ sudo apt-get install build-essential autoconf automake libtool flex bison debhelper binutils-gold
Download Jailkit from the following URL or visit its website to download the latest version, if any. Http://olivier.sessink.nl/jailkit/jailkit-2.16.tar.gz
$ wget http://olivier.sessink.nl/jailkit/jailkit-2.16.tar.gz
Extract
$ tar -vxzf jailkit-2.16.tar.gz
Compile and create deb Software Package
Jailkit already contains the code and configuration used to compile the software package into deb, which can be directly installed on Debian Linux. Run the following command to complete the process.
$ cd jailkit-2.16/$ sudo ./debian/rules binary
Install deb Software Package
The deb package created by the preceding command is called jailkit.2.16-1Amd64.deb.
$ cd ..$ sudo dpkg -i jailkit_2.16-1_amd64.deb
Now the Jailkit has been installed. Jailkit has many commands that can be used to set a chroot-based restricted environment:
$ jk_jk_addjailuser jk_chrootlaunch jk_cp jk_jailuser jk_lsh jk_uchroot jk_check jk_chrootsh jk_init jk_list jk_socketd jk_update
The preceding commands have man help information. If you use them, you can refer to them.
Reading:
Linux Shell parameter replacement http://www.linuxidc.com/Linux/2013-06/85356.htm
Shell for parameter http://www.linuxidc.com/Linux/2013-07/87335.htm
Linux/Unix Shell parameters passed to SQL script http://www.linuxidc.com/Linux/2013-03/80568.htm
Introduction to parameter passing methods in Shell scripts http://www.linuxidc.com/Linux/2012-08/69155.htm
Shell script PASS command line parameter http://www.linuxidc.com/Linux/2012-01/52192.htm