Subject: Re: Chrooting user + pop daemon
To: Kevin P. Neal <kpneal@pobox.com>
From: David Brownlee <abs@netbsd.org>
List: netbsd-help
Date: 08/10/2000 18:20:41
On Thu, 10 Aug 2000, Kevin P. Neal wrote:

> 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".
> 
	Exactly so.

> 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. 
> 
	'pax -rw -l srcdir destdir' should do the trick.

> The next trick is getting the user into the jail when they log on. Only
> root can do a chroot. 

	As Grzegorz initially mentioned - a modified login seems best.

                David/absolute
			       -- www.netbsd.org: A pmap for every occasion --