Use jailkit in Ubuntu to create a restricted Shell

Source: Internet
Author: User
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
  1. 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
  2. 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
  3. Extract

    $ tar -vxzf jailkit-2.16.tar.gz
  4. 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
  5. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.