Subject: Re: Chrooting user + pop daemon
To: Grzegorz 'Silk' Soba?ski <silk@go2.pl>
From: Kevin P. Neal <kpneal@pobox.com>
List: netbsd-help
Date: 08/10/2000 12:57:35
On Thu, Aug 10, 2000 at 06:38:28PM +0200, Grzegorz 'Silk' Soba?ski wrote:
> > Hmm. you would need to create a complete chroot()ed environment
> > for each user (probably creating a single master then using
> > hardlinks for all the files on each user would be best).
> Could you tell me how to do that?
> Or is it explained somewhere?
> Maybe on some man pages?

He's saying that when you chroot(), your / is the directory you
chdir()'d to. So, you would need a /bin in your chroot "jail".

What you need to do is make a directory on a big disk and then unpack
the NetBSD install tar files. Configure to taste. Then when you want to
make a new "jail" for a user you would have a script that builds the
new directory tree for the user and then does "ln" (NOT ln -s) to
make the system files and executables appear. 

There are programs to do similar things. For example, you may be able
to hack lndir or the equivalent in shtools (available on the net) to
do what you want. 


The next trick is getting the user into the jail when they log on. Only
root can do a chroot. 
-- 
Kevin P. Neal                                http://www.pobox.com/~kpn/

"You know, I think I can hear the machine screaming from here...  \
'help me! hellpp meeee!'"  - Heather Flanagan, 14:52:23 Wed Jun 10 1998