Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2000 15:47:50 -0600 (CST)
From:      Ryan Thompson <freebsd@sasknow.com>
To:        jimmy martin <hate00@hotmail.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Ftpd
Message-ID:  <Pine.BSF.4.10.10001101535290.3965-100000@sasknow.com>
In-Reply-To: <20000110175121.68023.qmail@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Jan 2000, jimmy martin wrote:

> How do I set anonymous acces to have acess to /usr/stuff?  I read the man 
> page for ftpd but i can find and "flags or options" to be able to add the 
> dir in with.  I tried to create link to there but ftp says file not found...

Hi, Jimmy.  There are a couple of ways.  I'm going to assume for this
message that your anon ftp root is in /var/ftp.

As you have already discovered, soft links to paths outside of your
ftp tree won't work.  This is due to the fact that ftpd runs logins in
a chroot environment.  So, when an anonymous user logs in, he/she will
have his/her root set to /var/ftp, and can not access files outside of
that tree... Even with symlinks.

One alternative, where possible, is to use hardlinks.  Normally, you can't
hard link a directory, nor can you create hard links across filesystems.
Nevertheless, you have the option.

Another alternative is to change your ftp root to /usr/stuff.  This can be
done by editing the 'ftp' user's home directory (as root) with chsh ftp, 
or by editing /etc/master.passwd appropriately, and executing pwd_mkdb to 
implement the change.  You then, of course, lose the contents of /var/ftp
for anonymous access :-)

Create another ftp user, and add them to /etc/ftpchroot, with a home
directory of /usr/stuff, and no write access to files therein.  Requires a
different login name, but perhaps this is what you want.

If /usr/stuff is small, you could always mirror it periodically to
/var/ftp/stuff.

If /usr/stuff is large enough to warrant it, put it on a dedicated slice
and mount it to /var/ftp/stuff

Symlinks can work the other way.  If you don't chroot anyone with access
to /usr/stuff (not /var/ftp), move the contents of /usr/stuff to
/var/ftp/stuff, and do ln -s /var/ftp/stuff /usr/stuff.

Other ftpds (have a look in the ports tree or packages) allow more
sophisticated functionality in terms of access control and
more customizable "mount points".  If you don't like any of my ideas, try
some different daemons.

The last symlink option usually makes the most sense... But, as I've
shown, there's more than one way to skin a fs. :-)

Virtually yours,
- Ryan Thompson

--
  Ryan Thompson <ryan@sasknow.com>
  50% Owner, Technical and Accounts
  Phone: +1 (306) 664-1161

  SaskNow Technologies     http://www.sasknow.com
  #106-380 3120 8th St E   Saskatoon, SK  S7H 0W2





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001101535290.3965-100000>