jailkit-users
[Top][All Lists]
Advanced

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

Re: [Jailkit-users] How to fix jailkit problems with /dev/null in FreeBS


From: Jordi Moles Blanco
Subject: Re: [Jailkit-users] How to fix jailkit problems with /dev/null in FreeBSD
Date: Thu, 31 May 2012 09:19:49 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120424 Thunderbird/12.0

Hi Olivier,

thanks for you answer.

Before trying such radical measure as copying /dev/null and running chmod 777 on it, I did try what you suggest, together with a bunch of other fixes that people talked about.

none work for me, only the one that I explained.

Jordi.


Al 30/05/12 22:06, En/na Olivier Sessink ha escrit:
On 05/29/2012 04:33 PM, Jordi Moles Blanco wrote:

3. You copy /dev/null in the jail "the FreeBSD way", that is,

cp /dev/null /jailkitpath/dev/null
I know little about FreeBSD, but on Linux you cannot copy devices with
cp. You have to create a device with mknod.

Well... although this /dev/null thing allows you to run some binaries,
it fails when for example you want to use git. The reason is because it
needs /dev/urandom and that doesn't exist in FreeBSD. Actually, we do
have /dev/urandom

but...

# ls -la /dev/urandom
lrwxr-xr-x  1 root  wheel  6 Nov  3  2011 /dev/urandom ->  random

it's a mere link...

which causes problems because

/dev/random doesn't work the same way as /dev/urandom

in order to fix this...

we have to literally copy /dev/random into the jail, again with "cp" and
not "jk_cp"

cp /dev/random /jailkitpath/dev/urandom
cp /dev/random /jailkitpath/dev/random
actually, you have to run these commands and then "ctrl+c", that is,
cancel the commands, after a second or two. If you don't do that, the
"cp" command will continue to create random numbers and store them in
the /jailkitpath/dev/random file.
again, use mknod and not cp them. Copy them will indeed copy the
contents, and not create a device.

Olivier



--
Jordi Moles Blanco
Sistemes Cdmon.com
___________________________
Tlf: 902 36 41 38
Tlf: 93 567 75 77
mailto: address@hidden
http://www.cdmon.com




reply via email to

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