Sharing application jail and host?
Albert.Shih at obspm.fr
Wed Sep 26 00:29:55 PDT 2007
Le 26/09/2007 à 08:47:05+0800, Aminuddin a écrit
> Hi freebsd gurus,
> I'm playing with jail setup and wanted to provide a virtual server to my
> external remote users to login by ssh and run a couple of applications.
> Do I need to install the application using the ports in the jail itself or
> can I just install the application in the host environment? Is there any
> methods to enable sharing of the application across the jail and host?
Yes it's possible, but if you just begin use jail and if you don't have
disk space problem it's better simple to install all applications in each
But if don't want to do this this is what you can do :
Make on reference jail (don't let user have access) only for
reference for example you can install this in
After that you create a new jail in
with in root dir
drwxr-xr-x 18 root wheel 512 Jan 15 2007 REF
lrwxr-xr-x 1 root wheel 7 Dec 19 2006 bin -> REF/bin
lrwxr-xr-x 1 root wheel 8 Dec 19 2006 boot -> REF/boot
dr-xr-xr-x 4 root wheel 512 Mar 12 2007 dev
drwxr-xr-x 18 root wheel 2048 Feb 1 2007 etc
drwxr-xr-x 19 root wheel 1024 Dec 19 2006 etc-local
lrwxr-xr-x 1 root wheel 7 Dec 19 2006 lib -> REF/lib
lrwxr-xr-x 1 root wheel 11 Dec 19 2006 libexec -> REF/libexec
dr-xr-xr-x 1 root wheel 0 Sep 26 09:24 proc
drwxr-xr-x 4 root wheel 512 Jul 5 21:56 root
lrwxr-xr-x 1 root wheel 8 Dec 19 2006 sbin -> REF/sbin
drwxr-xr-x 3 root wheel 512 Dec 18 2006 share
drwxrwxrwt 6 root wheel 512 Sep 26 03:01 tmp
lrwxr-xr-x 1 root wheel 7 Dec 19 2006 usr -> REF/usr
drwxr-xr-x 22 root wheel 512 Mar 12 2007 var
/jail/new-jail/usr/local/etc is a link to /etc-local
After that you mount in nullfs the /jail/REF in /jail/new-jail/REF
/jail/REF /jail/new-jail/REF nullfs rw 0 0
in your fstab.
When you finish you can install the application only in your REF
jail and automaticaly is install in all your jail.
The «danger» with this method is when you in the new-jail-21 (for example)
after some time you forget you using nullfs and .... you erase something
useless for new-jail-21 but absolutly need by new-jail-19....Because in a
jail you cannot see it's using nullfs.
Observatoire de Paris Meudon
SIO batiment 15
Téléphone : 01 45 07 76 26
Heure local/Local time:
Mer 26 sep 2007 09:20:27 CEST
More information about the freebsd-questions