From owner-freebsd-questions Tue Jan 27 07:45:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA07173 for questions-outgoing; Tue, 27 Jan 1998 07:45:32 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from millennium.net (mrvid.demon.co.uk [194.222.140.15]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA07123 for ; Tue, 27 Jan 1998 07:45:22 -0800 (PST) (envelope-from lists@mrvid.demon.co.uk) Received: from andy.millennium.net (andy [123.123.123.50]) by millennium.net (8.8.5/8.8.5) with SMTP id PAA16603 for ; Tue, 27 Jan 1998 15:50:14 GMT Message-Id: <3.0.32.19980127154350.006a0b40@123.123.123.1> X-Sender: lists@123.123.123.1 X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Tue, 27 Jan 1998 15:43:50 +0000 To: questions@FreeBSD.ORG From: Lists Subject: Re: ftp directories vs telnet Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk Hi >I want to put people who have an account on my machine into their respective web page >directory if they log in with a username and password thru FTP, but if they telnet in >i want them to go to their /home/xxxuser directory also if they FTP in using anonymous >login they go to the /var/ftp directory. >right now they go to: >telnet >> /home/xxxuser this is fine no changes needed >ftp anon >> /var/ftp fine no changes >ftp username > /home/xxxuser need to change to >/usr/local/www/data/xxxuser >the problem is if they upload webpages to /foo.bar.com/username it dont >get displayed cause its in the wrong directory. >they have to specifically upload to >/foo.bar.com/usr/local/www/data/username for it to go to the right >directory. I've patched ftpd.c to do what your asking, the way it works is as follows.. o User logs in e.g. user = kronus o Ftpd checks to see if the user's name (in this case, kronus) is listed in /etc/ftpwww o If it does exist then ftpd will change directory to /usr/local/www/data/kronus o It it doesn't it continues as it would normally. I've attached the tarball to an e-mail sent to your address, if anyone on the list wants a copy just ask and i'll forward it to you.. To install it, login as root and enter the following commands (all on one line), replace filename.tar.gz with the name of file ... mkdir /tmp/ftp ; cp -f filename.tar.gz /tmp/ftp ; cd /tmp/ftp ; tar xvzf filename.tar.gz ; make ; make install then just type make ; make install All you have to do then is to create /etc/ftpwww and put the user's in who you want to be automatically chdir'd to /usr/local/www/data/{username} If you need anything else adding just give me a shout.. L8rz KrOnUs