Apple's built in FTP server is rather limited, and can not be managed with Webmin. Although you could install the PureFTP server and GUI, I would much rather prefer something that works well with Webmin.
- This HelpFile was tested for OS X 10.5
- Apple's Xcode Developer Tools
- This HelpFile utilizes the wget binary. (see: Installing wget on OS X)
- This HelpFile utilizes Webmin. (see: Installing Webmin on OS X)
Open a terminal (or SSH into the system). Using the "wget" command, download the latest ProFTPD source code from the ProFTPD website (http://www.proftpd.org). Extract the files and change to the source code directory as shown.
As of the writting of this help file, the latest version is 1.3.2 which is avialable from ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.2.tar.gz.
tar xfvz proftpd-1.3.2.tar.gz
Compiling and Installing
Before compiling, we must configure the source code for our system. This is as easy as running the configure script that is included with the source code. The configure script lets you specify options on how you want to build your program. For example, where you want it to get installed. By default, ProFTPD will install into /usr/local. If you wish to change the install location, simply run the configure script with the "--prefix=/where/to/install" flag.
In the example below, I want to install all the ProFTPD files in it's own directory (/usr/local/proftpd). If you want to install ProFTPD into the default location (/usr/local), just omit the "--prefix=/usr/local/proftpd" when running the command below.
Once the configure script is done, type in "make" to start building the ProFTPD binaries. It will take a few minutes to compile ProFTPD depending on the speed of your system. Once the compilation is complete, install the binaries (as root) by typing in "sudo make install".
sudo make install
ProFTPD will by default use PAM to get system account information. This first needs to be enabled in OS X, otherwise users will not be able to log in with ProFTPD. The built in OS X FTP server utilizes the "/private/etc/pam.d/ftpd" authentication module. While ProFTPD is looking for "/private/etc/pam.d/ftp". Using the terminal, we will make a copy of the OS X FTP PAM module for ProFTPD.
cp /private/etc/pam.d/ftpd /private/etc/pam.d/ftp
Setting up ProFTPD with Webmin
Open up Webmin and configure the ProFTPD Webmin module by first expanding "Un-used Modules", then click on "ProFTPD Server". Click on "Module Config" and select the "System Configuration" category from the drop down. Change only the items shown below, then click "Save"
- Path to ProFTPD config file: /usr/local/proftpd/etc/proftpd.conf
- Path to ProFTPD executable: /usr/local/proftpd/sbin/proftpd
- Path to ProFTPD PID file:/usr/local/var/proftpd/proftpd.pid
Go to the "Webmin Configuration" section under the "Webmin" menu and click the button labeled "Refresh Modules" to have the "ProFTPD Server" module appear under the "Servers" menu.
Before we can start ProFTPD, we need to make some OS X specific adjustments. Go ahead and open up the "ProFTPD Server" module under the "Servers" section. Select the "Edit Config Files" option. Look for the line that has the comment "Set the user and group under which the server will run." and comment out the next two lines so it looks like this:
# Set the user and group under which the server will run.
Click the "Save" button to return to the main menu. By now you should have a functional FTP server. However, thier are a couple of "tweaks" I like to do to make things work a little better. Lets start by removing the login delay.
- Click on "Networking Options" in the ProFTPD module's main menu.
- Change the "Do reverse DNS lookups of client" option to "No".
- Change the "Lookup remote ident username" option to "No".
- Click "Save" to save and return to the main menu.
Lets allow the use of "CHMOD":
- In the main menu, under "Virtual Servers" click "Default server".
- Under "Per-directory and Per-command options" click "Commands SITE_CHMOD".
- Click "Access Control".
- Change the "Access Control Policy" option to "Allow all clients".
- Click "Save" to save. Then click "return to main menu".
Limit Users to Home Directory:
- Click on "Files and Directoriess" in the main menu.
- Change the "Limit users to directories" option to "Home Directory".
- Click "Save" to save and return to the main menu".
Before starting ProFTPD, please make sure to turn off and disable the OS X built in FTP server using server admin. To start the ProFTPD Server, click on the "Start Server" button on the main menu.
NOTE: Thier is a bug where the "apply changes" button will not restart ProFTPD. You must click on "Start Server" after you try to apply changes.
Now, go ahead and try accessing your server through FTP as a user.
Starting ProFTPD Automaticly on Boot
You probably want ProFTPD to start automaticly on boot instead of having to start it up manually each time. To setup an OS X startup item, just use Webmin.
- Open up Webmin, and go to the "Bootup and Shutdown" module under the "System" menu.
- Click on "Add a new bootup action script".
- Action Name: PROFTPD
- Script name: PROFTPD
- Bootup Commands: /usr/local/proftpd/sbin/proftpd
- Description: ProFTPD
- Provides: FTP
- Start Message: Starting ProFTPD
- Stop Message: Stopping ProFTPD
- Start at boot time?: Yes
- Click "Create"
It's safe to delete the source code directory and source code archive to keep your system nice and clean.