📕 subnode [[@bmann/2002 12 21 instructions for pre 10 2 systems]] in 📚 node [[2002-12-21-instructions-for-pre-10-2-systems]]

layout: post title: Instructions for pre 10.2 systems created: 1040519760 categories:

  • How To tags:
  • Mac
  • OS X
  • FTP

Anonymous FTP allows users without an account on your system to connect to your machine using FTP. Depending on the permissions you set, you can enable only downloads, or uploads and downloads, on a per folder basis. Enabling anonymous FTP means that anything you make accessible to the ftp user can be downloaded by anyone that finds your machine (i.e. knows your IP or domain name and types it into their ftp client).

This was done once on a "vanilla" install of Mac OS X 10.1, and not tested by me on any other machine. I plan on maintaining this document and noting changes and updates as I go. The most recent document will always be available at http://www.bmannconsulting.com/macosx/tipsntricks/. I am not responsible if you screw up your machine or someone downloads your secret files after you follow these instructions -- they are for informative purposes only.

Table of Contents

Before Starting

You'll need to be logged in as a user with administrative privileges. You'll also need to be somewhat comfortable with entering commands into the Terminal commandline.

Setup

  1. Go to "System Preferences" and select the "Users" control panel.
    1. Hit the "New User..." button
    2. On the next screen, type in Anonymous FTP (or anything you'd like) for the 'Full Name' field. For the 'Short Name' field, type in ftp.
    3. Just hit "OK" at this point -- don't fill out anything on the Password tab.
  2. Next, open the "NetInfo Manager" application (should be in the Utilities folder of your Applications folder).
    1. In the middle column, there should be a directory named "users" at the very bottom (you'll need to scroll down); highlight this directory.
    2. The third column should now display the list of users (short names) on your system; hilight the "ftp" user.
    3. The field at the bottom of the window should have a label that says "Directory: ftp". The list of Properties and Values should look just like the screen shot below. Double-click on the "Value(s)" field to edit them, and delete (select the entire row then hit the 'Delete' key) any properties not listed below. The only thing which may differ is the uid value -- this value is automatically incremented and will be different if you have more or less users.
      NetInfo Manager
      Click for a larger version.


    4. Quit NetInfo. You'll be prompted if you really, really want to save the changes, so select "OK" both times.

  3. Now we get to go play in the Terminal! Open the "Terminal" application, also in your "Utilities" folder by default. The first sudo command will list a warning and prompt you for your password -- you will need to be a user with administrative privileges.

    Welcome to Darwin!

    [localhost:~] yourusername%

    The above is what it should say in your Terminal window, where "yourusername" is what the Short Name for your user account is.
    1. Go to the ftp users home directory:

      cd /Users/ftp

      [localhost:/Users/ftp] yourusername%

    2. Delete all the folders in the directory -- be incredibly careful with this command, and make sure that you've typed the path correctly!

      sudo rm -rf /Users/ftp/*

    3. Create necessary folders:

      [localhost:/Users/ftp] yourusername%

      sudo mkdir pub

    4. Restrict the anonymous ftp users to only the local ftp user folder:

      [localhost:/Users/ftp] yourusername%

      sudo chroot -u ftp /Users/ftp

      You may get an error message after running this command, but ignore it, it did what it was supposed to.

    5. Set the ownership & permissions on the folders:

      [localhost:/Users/ftp] yourusername%

      sudo chown -R root.nobody /Users/ftp

      sudo chown -R root.staff pub

      sudo chmod 555 /Users/ftp

      sudo chmod 755 pub

  4. You're done! Now all you need to do is test it.
    1. Open Internet Explorer, any other of your favourite browsers, or an FTP client you are comfortable with.
    2. Enter in the address ftp://localhost (alternately, enter your hostname or your IP address if you know it). You should see a directory listing with a folder icon labelled pub, which is the initial folder you created.

      Put things in the pub directory to allow people to start downloading them. Remember, anything you put in the pub directory will be available to anyone.

Sources

X Appeal.org:
Setting Up Your Own Anonymous FTP Server

These instructions were for Mac OS X Server. I used them as a guide when setting it up under Mac OS 10.1.

man ftpd:
Output from the Mac OS X 10.1.1 "man ftpd" command. I've recreated it here.

Acknowledgements

Testing and Feedback
Karl Timmerman

FAQ

Please check the current FAQs. If you have any questions, you can also submit them directly.

Changelog
Version 1.2a, February 23, 2002
  • Moved page to phpWebSite system
  • Moved FAQ to Questions plug-in for phpWebSite
Version 1.2, January 21, 2002
  • Removed red herring about copying commands in to ftp user directory
  • Made changes to pub permissions to allow downloads only
  • Moved FAQ to faqengine
Version 1.1, November 17, 2001
  • First feed back
  • Added sudo in front of copy commands
  • Added FAQ with instructions for welcome message and upload/download permissions
Version 1.0, November 9, 2001
  • Initial write up
📖 stoas
⥱ context