Subject: Changing out of a Chrooted dir

From: George Baker <[email-masked]>
Date: Tue, 06 Apr 1999 10:57:00 -0400

I've scoured the WU-FTPD docs, man pages, and FAQs but haven't been able to 
find a way to do this. I have user who needs to be able to upload to my 
anonymous dir. I don't want anyone else to be able to upload to it just 
him. At the same time I don't want to make it his home dir. I noticed 
that in this case the FAQ mentioned something about loopback mounts. I'm 
using RedHat 5.1 and everything I can find about loopbacks says that they 
only work with files and not dirs. I come from an NT background where this 
was very easy to do. Any ideas?

Thanks,George

---

From: Gregory A Lundberg <[email-masked]>
Date: Tue, 6 Apr 1999 11:22:40 -0400 (EDT)

On Tue, 6 Apr 1999, George Baker wrote:

> I've scoured the WU-FTPD docs, man pages, and FAQs but haven't been
> able to find a way to do this. I have user who needs to be able to
> upload to my anonymous dir. I don't want anyone else to be able to
> upload to it just him. At the same time I don't want to make it his
> home dir. I noticed that in this case the FAQ mentioned something
> about loopback mounts. I'm using RedHat 5.1 and everything I can find
> about loopbacks says that they only work with files and not dirs. I
> come from an NT background where this was very easy to do. Any ideas?

Use a loopback mount.  Read the manpage 'man 8 losetup'.  You may need to
rebuild your kernel to add support for it.

Yes, from the point of view of the main filesystem, the loopback mount is
a file.  Inside the file it's a filesystem, but you can only see that once
it's mounted.

A word of caution: the loopback mount occurs after the fsck during
startup.  That means you'll need to be sure to explicitly run fsck on the
filesystem when you mount it.

-- 

Gregory A Lundberg              Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195

---

From: Bob Luckin <[email-masked]>
Date: Tue, 06 Apr 1999 12:12:55 CDT

> was very easy to do. Any ideas?

Does he need to upload directly into the anonymous directory at the top
level, or can you create a subdirectory underneath it ?  If you can use a
subdirectory, then you might be able to avoid the need for loopback mounts
as follows...

You could create a subdirectory which can only be written to by someone who
is in a special group.  People who log in anonymously are not in this group
by default, so they would be able to see the directory, but not write to it.
You can give your favoured user a password to let them change their group to
the one which is able to write to the subdirectory.  So whenever they wanted
to upload, they could log in as anonymous, change to the new group, cd to
their upload directory and do the necessary.  See the documentation on the
ftpaccess "private" directive and site group / site gpass commands for more
details.

However, a loopback mount may suit your purposes better - it has the advantage
that the user can log in with his normal id and password and access the upload
directory under his home directory without any special effort on his part.

Cheers, Bob
-- 
Bob Luckin      [email-masked]      "Coder, adapt.  FTP Ada, redo C"
                                 [http://www.dhc.net/~luckin/palindromes.html]