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).
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
- Go to "System Preferences" and select the "Users" control panel.
- Hit the "New User…" button
- 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.
- Just hit "OK" at this point – don’t fill out anything on the Password tab.
- Next, open the "NetInfo Manager" application (should be in the Utilities folder of your Applications folder).
- In the middle column, there should be a directory named "users" at the very bottom (you’ll need to scroll down); highlight this directory.
- The third column should now display the list of users (short names) on your system; hilight the "ftp" user.
- 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.
Click for a larger version.
- Quit NetInfo. You’ll be prompted if you really, really want to save the changes, so select "OK" both times.
- 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.
- Go to the ftp users home directory:
- 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/*
- Create necessary folders:
sudo mkdir pub
- Restrict the anonymous ftp users to only the local ftp user folder:
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.
- Set the ownership & permissions on the folders:
sudo chown -R root.nobody /Users/ftp
sudo chown -R root.staff pub
sudo chmod 555 /Users/ftp
- Go to the ftp users home directory:
- You’re done! Now all you need to do is test it.
- Open Internet Explorer, any other of your favourite browsers, or an FTP client you are comfortable with.
- 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.
- 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.
- Testing and Feedback
- Karl Timmerman
Please check the current FAQs. If you have any questions, you can also submit them directly.
- 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
Notes mentioning this note
There are no notes linking to this note.