Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 1998 15:43:50 +0000
From:      Lists <lists@mrvid.demon.co.uk>
To:        questions@FreeBSD.ORG
Subject:   Re: ftp directories vs telnet 
Message-ID:  <3.0.32.19980127154350.006a0b40@123.123.123.1>

next in thread | raw e-mail | index | archive | help

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 <kronus@null.net>






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