197 lines
6.9 KiB
HTML
197 lines
6.9 KiB
HTML
<!--startcut ======================================================= -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<html>
|
|
<head>
|
|
<META NAME="generator" CONTENT="lgazmail v1.2J.g">
|
|
<TITLE>The Answer Guy 42: Loopback (localhost) NFS Mounting for FTP</TITLE>
|
|
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
|
LINK="#3366FF" VLINK="#A000A0">
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
|
|
<P> <hr> <P>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<center>
|
|
<H1><A NAME="answer">
|
|
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
|
|
border="0" align="middle">
|
|
<font color="#B03060">The Answer Guy</font>
|
|
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
|
|
border="0" align="middle">
|
|
</A></H1>
|
|
<BR>
|
|
<H4>By James T. Dennis,
|
|
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
|
|
LinuxCare,
|
|
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
|
|
</H4>
|
|
</center>
|
|
|
|
<p><hr><p>
|
|
<!-- endcut ======================================================= -->
|
|
<!-- begin 1 -->
|
|
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
|
|
height="50" width="60" alt="(?) " border="0"
|
|
>Loopback (localhost) NFS Mounting for FTP</H3>
|
|
|
|
|
|
<p><strong>From Mark S. Turczan on Sun, 02 May 1999
|
|
</strong></p>
|
|
<!-- ::
|
|
Loopback (localhost) NFS Mounting for FTP
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
:: -->
|
|
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
James,
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
Would you know of a way to setup a loopback mount within a <TT>/home/ftp</TT>
|
|
hierarchy?
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
Or could you provide a better method to achieve the following?
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
I've got a set of disks setup under software raid, and I've mounted them
|
|
under <TT>/mnt/raid.</TT> What I'd like to do is include a link from a directory
|
|
under <TT>/home/pub/Archive</TT> to the actual files under <TT>/mnt/raid/Archive.</TT>
|
|
I've tried doing this with a symbolic link, but it doesn't seem to
|
|
resolve it when I connect through ftp.
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
When you connect as "anonymous" or "ftp" through the
|
|
conventionally configure FTP service, or as any member of
|
|
a "guestgroup" to a WU-FTP daemon, you are in a chroot
|
|
jail. This is intended to prevent you (an FTP client)
|
|
from wandering around the filesystem peeking into things
|
|
where you don't belong (as an anonymous or guest user).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Naturally symbolic links don't pierce through a chroot
|
|
wall.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
It's possible to configure your system to act as an
|
|
NFS server and client (concurrrently) and to export a
|
|
directory tree (presumably in read-only mode) to yourself.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
This is one of several tricks that is referred to as a
|
|
"loopback mount" (not to be confused with the
|
|
<tt>mount -o loop=</tt>... option which is a way of mounting a
|
|
file image as a filesystem). In this case you're doing
|
|
a perfectly normal NFS export, and a perfectly normal
|
|
NFS mount. The only oddity is that the export and mount
|
|
are on the same machine and are going through the loopback
|
|
network interface.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
So you put a line in your <TT>/etc/exports</TT> file like:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><Code>
|
|
<TT>/mnt/raid/ftparea</TT> 127.0.0.1(ro,insecure)
|
|
</Code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... and possibly some lines like:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><Code>
|
|
<TT>/mnt/raid/ftparea/no/</TT> (noaccess)
|
|
</Code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
(to define a set of subdirectories under the
|
|
exported directory tree to which you want to deny
|
|
access).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... and then you use a command like:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BLOCKQUOTE><CODE><BlockQuote>
|
|
mount -t nfs 127.0.0.1:/mnt/raid/ftparea <TT>/home/ftp/home</TT>
|
|
</BlockQuote></CODE></BLOCKQUOTE></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... or whatever.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Personally I think it's horrible kludge. But I've
|
|
done things sort of like this and it does work.
|
|
</BLOCKQUOTE>
|
|
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
Thanks for any help you can offer.
|
|
<br>--
|
|
<br>Mark Turczan
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
Hope that makes sense.
|
|
</BLOCKQUOTE>
|
|
<!-- sig -->
|
|
|
|
<!-- end 1 -->
|
|
|
|
<!--startcut ======================================================= -->
|
|
<P> <hr> <P>
|
|
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
|
|
>Copyright ©</a> 1999, James T. Dennis
|
|
<BR>Published in <I>The Linux Gazette</I> Issue 42 June 1999</H5>
|
|
<H6 ALIGN="center">HTML transformation by
|
|
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
|
|
Starshine Techinical Services,
|
|
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
|
|
</H6>
|
|
<P> <hr> <P>
|
|
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<TABLE WIDTH="97%"><TR VALIGN="center" ALIGN="center">
|
|
<TD ROWSPAN="4" COLSPAN="1" WIDTH="37%"><A
|
|
HREF="../lg_answer42.html"
|
|
><IMG SRC="../../gx/dennis/answernew.gif"
|
|
ALT="[ Answer Guy Index ]"></A></td>
|
|
<TD WIDTH="10%"><A HREF="1.html">1</A></TD>
|
|
<TD WIDTH="10%"><A HREF="2.html">2</A></TD>
|
|
<TD WIDTH="10%"><A HREF="3.html">3</A></TD>
|
|
<TD WIDTH="10%"><A HREF="4.html">4</A></TD>
|
|
<TD WIDTH="10%"><A HREF="5.html">5</A></TD>
|
|
<TD WIDTH="10%"><A HREF="6.html">6</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="7.html">7</A></TD>
|
|
<TD><A HREF="8.html">8</A></TD>
|
|
<TD><A HREF="9.html">9</A></TD>
|
|
<TD><A HREF="10.html">10</A></TD>
|
|
<TD><A HREF="11.html">11</A></TD>
|
|
<TD><A HREF="12.html">12</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="13.html">13</A></TD>
|
|
<TD><A HREF="14.html">14</A></TD>
|
|
<TD><A HREF="15.html">15</A></TD>
|
|
<TD><A HREF="16.html">16</A></TD>
|
|
<TD><A HREF="17.html">17</A></TD>
|
|
<TD><A HREF="18.html">18</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="19.html">19</A></TD>
|
|
<TD><A HREF="20.html">20</A></TD>
|
|
<TD><A HREF="21.html">21</A></TD>
|
|
<TD><A HREF="22.html">22</A></TD>
|
|
<TD><A HREF="23.html">23</A></TD>
|
|
<TD><A HREF="24.html">24</A></TD>
|
|
</TR></TABLE>
|
|
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<P> <hr> <P>
|
|
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<A HREF="../../index.html"
|
|
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
|
|
<A HREF="/index.html"
|
|
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
|
|
<A HREF="../lg_bytes42.html"
|
|
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
|
|
<A HREF="../lg_tips42.html"
|
|
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
|
|
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
</BODY></HTML>
|
|
<!--endcut ========================================================= -->
|