Enabling anonymous FTP

Dec 06, '00 04:54:24PM

Contributed by: Anonymous

Anonymous FTP allows guests to access your machine in a limited manner, to either upload or download files. You can put FTP links on web pages that connect the users directly to your anonymous site; it's a convenient way of giving them easy downloads.

Read on for step-by-step directions on how to set this up on your machine. Before proceeding with this one, you should be comfortable at the command line, and probably have at least some knowledge of users, groups, and permissions in UNIX.

1) All of step one is done using Terminal, which is located in /Applications/Utilities.

Note - replace all references to "user" with your username or root (it's more convenient with your username because you can easily drop things into /Users/ftp/pub).

a) First create a directory in /Users that looks like this:

drwxr-xr-x   9 user     ftp    262 Nov  1 15:32 ftp
b) Then in /Users/ftp create the following directories:
bin
usr/lib
System/Library/Frameworks/System.framework/Versions/B
pub
incoming
c) Copy the following files to their respective corresponding directories in the ftp directory:
/bin/ls
/usr/lib/dyld
/System/Library/Frameworks/System.framework/Versions/B/System
d) In /Users/ftp make sure the file permissions look like this:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:29 System
dr-xr-xr-x 3 user ftp 58 Oct 4 15:30 bin
drwx-wx-wx 10 user ftp 296 Oct 30 02:06 incoming
drwxr-xr-x 6 user ftp 160 Nov 1 01:01 pub
dr-xr-xr-x 3 user ftp 58 Oct 4 15:29 usr

./System:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:29 Library

./System/Library:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:29 Frameworks

./System/Library/Frameworks:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:29 System.framework

./System/Library/Frameworks/System.framework:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:29 Versions

./System/Library/Frameworks/System.framework/Versions:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:30 B

./System/Library/Frameworks/System.framework/Versions/B:
total 2408
-r-xr-xr-x 1 root ftp 1231624 Oct 4 15:30 System

./bin:
total 56
-r-xr-xr-x 1 user ftp 26920 Oct 4 15:30 ls

./usr:
total 0
dr-xr-xr-x 3 user ftp 58 Oct 4 15:30 lib

./usr/lib:
total 616
-r-xr-xr-x 1 user ftp 312384 Oct 4 15:30 dyld
Note: if you don't know how to change permissions, read the man (man command-name) pages for:
chown for changing file/directory ownership
chgrp for changing file/directory group ownership
chmod for changing file directory user/group/other permissions

2) You have to manually create an ftp user using NetInfoManager which is located in /Applications/Utilities:
  1. open NetInfoManager
  2. under /users create a new directory and label it ftp
  3. enter the following properties and values (shown as property | value)
For passwd, make sure you put an asterix (*) and do not leave it empty, as this would allow the ftp user to login at the login screen of Aqua! Also make sure the shell is /dev/null, or the ftp user will be able to rlogin and telnet in and wreak havoc.

Finally, you don't have to have the "home" be /Users/ftp, "home" just has to be the location of the ftp directory you created in step one, which could conceivably be anywhere. Another logical place to put it might be in the same place as your WebServer, in /Library .

You should now be good to go. Good luck!

Comments (26)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20001206165424178