Instructions for pre 10.2 systems

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).</p> <p class="note">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.</p> <h2>Table of Contents</h2> <ul> <li>Before Starting</li> <li>Setup</li> <li>Sources</li> <li>Acknowledgements</li> </ul> <h2>Before Starting</h2> 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.</p> <h2>Setup</h2> <ol> <li>Go to "System Preferences" and select the "Users" control panel. <ol type="a"> <li>Hit the "New User…" button</li> <li>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.</li> <li>Just hit "OK" at this point – don’t fill out anything on the Password tab.</li> </ol> </li> <li>Next, open the "NetInfo Manager" application (should be in the Utilities folder of your Applications folder). <ol type="a"> <li type="a">In the middle column, there should be a directory named "users" at the very bottom (you’ll need to scroll down); highlight this directory.</li> <li type="a">The third column should now display the list of users (short names) on your system; hilight the "ftp" user.</li> <li type="a">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.


</li> <li type="a">Quit NetInfo. You’ll be prompted if you really, really want to save the changes, so select "OK" both times.

</li> </ol> </li> <li>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. <p class="code">Welcome to Darwin!</p> <p class="code">[localhost:~] yourusername%</p> The above is what it should say in your Terminal window, where "yourusername" is what the Short Name for your user account is. <ol type="a"> <li>Go to the ftp users home directory: <p class="code">cd /Users/ftp</p> <p class="code">[localhost:/Users/ftp] yourusername%</p></li> <li>Delete all the folders in the directory – be incredibly careful with this command, and make sure that you’ve typed the path correctly! <p class="code">sudo rm -rf /Users/ftp/*</p></li> <li>Create necessary folders: <p class="code">[localhost:/Users/ftp] yourusername%</p> <p class="code">sudo mkdir pub</p></li> <li>Restrict the anonymous ftp users to only the local ftp user folder: <p class="code">[localhost:/Users/ftp] yourusername%</p> <p class="code">sudo chroot -u ftp /Users/ftp</p> <p class="note">You may get an error message after running this command, but ignore it, it did what it was supposed to.</p></li> <li>Set the ownership & permissions on the folders: <p class="code">[localhost:/Users/ftp] yourusername%</p> <p class="code">sudo chown -R root.nobody /Users/ftp</p> <p class="code">sudo chown -R root.staff pub</p> <p class="code">sudo chmod 555 /Users/ftp</p> <p class="code">sudo chmod 755 pub</p></li> </ol> </li> <li>You’re done! Now all you need to do is test it. <ol type="a"> <li>Open Internet Explorer, any other of your favourite browsers, or an FTP client you are comfortable with.</li> <li>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. <p class="note">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.</p></li> </ol> </li> </ol> <h2>Sources</h2><dl><dt>X Appeal.org:</dt><dd> Setting Up Your Own Anonymous FTP Server</p><dd> These instructions were for Mac OS X Server. I used them as a guide when setting it up under Mac OS 10.1.</p><dt>man ftpd:</dt><dd> Output from the Mac OS X 10.1.1 "man ftpd" command. I’ve recreated it here.</p></dl> <h2>Acknowledgements</h2> <dl> <dt>Testing and Feedback</dt> <dd> Karl Timmerman</p> </dl> </td></tr><tr><td class="type5" width="90%" valign="top">FAQ

Please check the current FAQs. If you have any questions, you can also submit them directly.</p> </p></td></tr><tr><td class="type5" width="90%" valign="top">Changelog <dl><dt>Version 1.2a, February 23, 2002</dt><dd><ul><li>Moved page to phpWebSite system</li><li>Moved FAQ to Questions plug-in for phpWebSite</li></ul> <dt>Version 1.2, January 21, 2002</dt> <dd><ul><li>Removed red herring about copying commands in to ftp user directory</li> <li>Made changes to pub permissions to allow downloads only</li> <li>Moved FAQ to faqengine</li> </ul> <dt>Version 1.1, November 17, 2001</dt> <dd><ul><li>First feed back</li> <li>Added sudo in front of copy commands</li> <li>Added FAQ with instructions for welcome message and upload/download permissions</li> </ul> <dt>Version 1.0, November 9, 2001</dt> <dd><ul><li>Initial write up</li></ul> </dl>