Allowing Anonymous FTP Access


By default, anonymous FTP is not enabled; the easiest way to enable it, if you choose to do so, is through Sysinstall. Within the Sysinstall program (/usr/sbin/sysinstall), enter the Configure and Networking sections. Scroll to the Anon FTP option and press the spacebar to enter the Anonymous FTP Configuration screen, shown in Figure 27.2.

Figure 27.2. Anonymous FTP configuration options.


The default options are generally appropriate for a typical FreeBSD system. The UID, Group, and Comment fields control how the new ftp user will be created. This user's home directory is set to /var/ftp, which is how anonymous FTP worksthe ftp login is treated as a regular user that behaves as if it's listed in /etc/ftpchroot, so anybody logging in as ftp (or its alias, anonymous) will be put into a chroot jail at /var/ftp.

You can change any of the fields to suit your system (for instance, if you already have a user with a UID of 14, or if you want a name for the upload directory that's different from incoming). When you select OK at the bottom of the screen, the ftp user will be created, as will the /var/ftp TRee with its necessary subdirectories.

Note that Sysinstall doesn't provide the capability to disable anonymous FTP after it has been enabled, but you can do this in a number of ways. The following methods are ranked in descending order of preferability:

  • Add the ftp user to /etc/ftpusers (probably the easiest and cleanest method). This prevents the ftp user, the anonymous guest user, from connecting using FTP's own mechanisms.

  • Change the permissions on the /var/ftp tree so that its contents can't be read by regular userschmod 0700 /var/ftp will work.

  • Remove the /var/ftp TRee.

  • Remove the ftp user.

Similarly, you can disable the upload (incoming) directory by simply removing it, or else by changing its permissions to 755 (the default directory permissions, in which only the ownerrootcan write into it). Reenable it (or any other directory to which you want anonymous users to be able to upload files) by changing its permissions to 1777for instance, chmod 1777 /var/ftp/incoming.




FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net