[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Jailkit-users] How to setup GIT properly in a jailed environment

From: Tom Handy
Subject: [Jailkit-users] How to setup GIT properly in a jailed environment
Date: Thu, 3 Feb 2011 15:34:03 +0100


I am running Jailkit v2.11 on an Unbuntu server 10.04.

We use this server for multiple functions. At the moment we use it for testing 
of website and running a git repository. 

We also wanted to jail the git users to that they could not actually logon to 
the gitserver but could access it though git tools on their local machine.

STEP 1: Install git on the server & create a shared central repository
apt-get install git-core
adduser git
mkdir /var/git/

STEP 2: Add a jailed user who can access the shared central repository
adduser --ingroup git username
jk_jailuser -s /usr/bin/git-shell -m -j /home/jail "username"
cd /home/jail/home/username/
mkdir git
mount -o bind /var/git/ git/

The guys were testing the system and it turns out that certain git commands 
where not available to the jailed users.
So I imported the git-core libraries from /usr/lib/git-core to the jail withe 
the following command
jk_cp -j /home/jail/ /usr/lib/git-core/* 

Now for the problem...
Some of these git commands use linux commands like uname which just generate 
the "command not found"  error.

How can I go about added all the command that are need to run git?

I suppose one option is to copy over everything from /usr/bin but if I do that 
surely that will defeat the purpose of having a jailed environment.
I would like to be bale to fix this in one go rather than just added missing 
commands as we come across them.

If anyone has any insight in to how to get this resolved please let me know.

Best regards,
Tom Handy

reply via email to

[Prev in Thread] Current Thread [Next in Thread]