Subject: Repeated virtual server usernames possible?

From: Matt Bruce <[email-masked]>
Date: Mon, 07 Jul 1997 21:41:50 +0800

Hi,

Please forgive what is probably an ObQ -- I'm a newbie to this list. Is
it possible to set usernames on a virtual ftp server that:

    1) aren't in the real /etc/passwd file, and
    2) may be duplicated across other virtual ftp servers but relate to
different users?

I've read the FAQ and the "Setting up guest accounts..." document and
didn't get the answer I was hoping for.

The latter document seems to imply that the entry must both be in the
/etc/passwd and ~virtualserver/etc/passwd files. Is this true? Or is
there some new technique about that'll enable wu-ftpd to do what I want?

Regards,

--
+----------------------+------------------------------------+
| Matt Bruce           | Highway1 (Australia) Pty Ltd       |
| Support  &  Sysadmin | 820 Beaufort St, Inglewood WA 6052 |
| [email-masked] | http://www.highway1.com.au/        |
+----------------------+------------------------------------+
 "How do you shoot the devil in the back? What if you miss."
  -- Verbal Kint from "The Usual Suspects"

---

From: Jim Dennis <[email-masked]>
Date: Mon, 07 Jul 1997 09:50:31 -0700

> | Matt Bruce           | Highway1 (Australia) Pty Ltd       |

	Apparently it's possible to do this using tcp_wrappers
	the 'chroot' command, and any ftpd.

	Some mail I got from Wietse Venema points out that any
	service can be redirected (via the twist command) according
	to which IP alias the packets are destined.  (The usual
	use of tcpd is to base the access controls and twists on
	the *source* IP address -- but it supports a syntax for
	the *destination* as well).

	I've never sat down and fought with this to figure out
	what the exact incantations are.  However I think it will
	do what you want -- you do the chroot *before* launching
	ftpd (any ftpd -- wu or vendor supplied).  This will cause
	the ftpd to authenticate against the /etc/passwd (and 
	possibly the /etc/shadow) in this chroot environment.  
	Your ftpd might be configured to chroot *again* (after 
	authentication).

		/
		/etc/	-- hosts.allow with tcpd "twist"
			-- "real passwd file"
		/chroot1/
			/etc	-- passwd file for virtual host 1
			/ftpchroot
				/etc -- fake passwd for ftpd and ls
				/usr/bin -- just ls (gzip, etc)
				/pub
		/chroot2/
			/etc	-- passwd file for virtual host 2
			/ftpchroot
				/etc -- fake passwd for ftpd and ls
				/usr/bin -- just ls (gzip, etc)
				/pub
		(etc).
			
	I realize that this appears to use alot of disk space.  
	You can use *hard* links (NOT symlinks) between the different 
	virtual trees -- so long as the exist on the same file systems 
	(under the same mount points).  Normally you'll have to create the 
	directories and link the files (hard links to directories are 
	normally reserved for just the ".." (parent) entries of each 
	subdirectories -- normally you can't make multiple "downward" 
	hard links to a directory).

	I hope this helps.  

	If anyone else here as actually used tcpd's "virtual host/twist"
	option (with ftp or any other service) I'd love to see a 
	working example of the hosts.allow and other related files.

--
Jim Dennis,                                [email-masked]
Proprietor,                          [email-masked]
Starshine Technical Services              http://www.starshine.org

        PGP  1024/2ABF03B1 Jim Dennis <[email-masked]>
        Key fingerprint =  2524E3FEF0922A84  A27BDEDB38EBB95A