Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 1995 13:20:22 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        ghelmer@alpha.dsu.edu (Guy Helmer)
Cc:        mango@communique.net, questions@freebsd.org
Subject:   Re: Secure ftp under FreeBSD...
Message-ID:  <199511282020.NAA21951@phaeton.artisoft.com>
In-Reply-To: <Pine.OSF.3.91.951127155255.9704A-100000@alpha.dsu.edu> from "Guy Helmer" at Nov 27, 95 04:11:38 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > I am trying to set secure ftp on a FreeBSD box;  ie, all my users can ftp
> > into the box, but, as they get in, I want to chroot them to their home 
> > directory...
> 
> Interesting -- I'd be interested in hearing how you solve the need for
> "/bin/ls" relative to each user's home directory...

I thought this as well, but I didn't say it.  8-).

A statically linked ls would be a good deal, and as long as all users
were on the same drive, you could hard link it between their home
directories.  Kinda bogus if they can unlink it and replace it with
a hard link to, for instance, /bin/sh.


Actually, there is a mechanism for per process root search override
based on the fdp in the proc struct.  It's a little screwed up right
now because the value is only initialized on a chroot and then
conditionally used, when actually it should be initialized for
everyone at fork time and unilaterally used (removing the rootvp
reference in vfs_lookup.c).

You *could* fix the problem using that mechanism in combination with
removing the ftpd's ability to execute arbitrary commands.  Then
look up binaries (all one of them) relative to the system root by
way of opening the system root and using fchdir() after the fork to
put the search path back for the subshell.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511282020.NAA21951>