Jail v1.0

A kick and dirty chrooted login shell implementation Released under GNU Public License v 2.0
Juan M. Casillas

INTRODUCTION

jail is a chrooted environment using bash. its main use is to put it as shell for any user you want to be chrooted. To work propertly, you have to copy some libraries into the chrooted environment, so the user have some commands to work :) The environment is built using the script 'mkenv.sh' provided in this distribution

DOWNLOAD

Sources are available here !

INSTALLATION

just untar the package and do a 'make' ; next, if you want install it, type 'make install' as root. The default install directory is '/usr/local/bin'. If you want to change anything, you can edit Makefile and jail.c.

Next, add an user account. In the shell field of the password file, put the 'jail' shell, just like that:

	test:x:1000:1000:Test User,,,:/home/test:/usr/local/bin/jail

Note that the chrooted directory becomes /home/test ... and you have setup propertly this directory, running the script I provided, mkenv.sh, as root user, just like that:

	# ./mkenv.sh /home/test

And that is. You can run it after doing the 'adduser' command

BUGS

Under IRIX 6.5, the process being killed by itself. After a while tracing it, I discover in google that there is a bug in the execve() system call.

RELEASE

This version is 1.0 release. Currently pretty stable. The developement was done under a Linux box using debian potato 2.2 and gcc 2.95.3.

WARNING

This version has been tested under linux, so if you change your platform, you have to change the mkenv.sh script so the right libraries and files will be copied. If you setup mkenv.sh for another platform, please send it to me, so I put it into the package.

FEEDBACK

Please feedback all questions, bugs, enhancenments and so on to assman@gsyc.inf.uc3m.es. Please check the Web Site (http://www.gsyc.inf.uc3m.es/~assman/jail/) for upgrades and more info !

Enjoy it. - Juan M. Casillas