Subject: vsftpd chroot
To: None <netbsd-help@netbsd.org>
From: Christoph Dietzschold <cd@hoerbe.net>
List: netbsd-help
Date: 07/20/2004 22:40:27
Hi folks,

I just tried out to get my vsftpd working in a chroot-environment, but 
something is still going wrong there I think.
Everytime I try to start the vsftp via /etc/rc.d/vsftpd start It starts but 
does not chroot it self. It uses the configfile in
/usr/pkg/etc/vsftpd/ may be It ist the default dir for the vsftpd.

So I asked google for som more information, but found nothing useful, may 
be you could help me.

did anyone set up a chrooted vsftpd yet? I would be pleased if you could 
tell me what to do :)

bash-2.05b# ls -l /etc/rc.d/vsftpd
-rwxr-xr-x  1 root  wheel  339 Jul 20 22:24 /etc/rc.d/vsftpd

bash-2.05b# cat /etc/rc.d/vsftpd
#!/bin/sh
#
# $NetBSD: vsftpd.sh,v 1.1 2003/05/09 23:31:39 salo Exp $
#

# PROVIDE: vsftpd
# REQUIRE: DAEMON LOGIN

. /etc/rc.subr

name="vsftpd"
rcvar=$name
command="/usr/pkg/libexec/${name}"
command_args="&"
required_dirs="/var/chroot/vsftpd"
required_files="/var/chroot/vsftpd/etc/vsftpd.conf"

load_rc_config $name
run_rc_command "$1"

bash-2.05b# cat /etc/rc.conf
[...]
vsftpd=YES
vsftpd_chrootdir="/var/chroot/vsftpd"

Thanks a lot

with best regads

--
Christoph Dietzschold

hoerbe.net