So here is my attempt at the quick and dirty of getting pure-ftpd to run on a Mac and authenticate using Mac accounts. I had originally tackled this using Homebrew to do the install, but I had difficulty knowing where to make the appropriate configuration changes. By configuring and compiling it manually, you can then configure it using its documentation.
So, first, you need to download the tarball (ZIP file) from pureftpd.org I used the 1.0.46 release (of course, they added the newest release today 1.0.47), but the steps should be pretty much the same for all releases. So, I downloaded: pure-ftpd-1.0.46.tar.gz
So, get the file and put it in whatever directory you want on the Mac. I left it in my Downloads directory.
Open up Terminal and go to the directory with the downloaded tarball. Extract it. Next, change into the extracted directory. You will then configure the installation. Last, you will compile and install. Here is the code (assuming it is in Downloads and is version 1.0.46).
Code:
cd ~/Downloads <- change to Downloads directory ->
tar xzf pure-ftpd-1.0.46.tar.gz <- extract the tarball ->
cd pure-ftpd-1.0.46 <- change into extracted folder ->
./configure --with-everything --with-virtualchroot --without-humor <-this configures the installer. You may also need the --with-pam switch ->
sudo make install-strip <- compile and install ->
At this point, it should be installed and ready to be run. The FTP server executable is in the /usr/local/sbin directory.
So, change to that directory and start the server.
So, run this:
Code:
cd /usr/local/sbin <- change to the appropriate directory
sudo ./pure-ftpd & <- start the server
If you test at this time using FileZilla, it should be able to connect anonymously, but not be able to upload. If you try to use the credentials of a user on the Mac, it should give an authentication error. At the least, you should be able to tell that the server is up and running.
You need to set up PAM authentication. To do this, you need to create a pure-ftpd file and put it in the /etc/pam.d/ directory.
Here is the sample file that should work. Remember that it is named: pure-ftpd
Code:
# pure-ftpd: auth account password session <- this is just a comment line
auth required pam_opendirectory.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so
After placing that file in the /etc/pam.d/ directory, run the server start command again.
Code:
cd /usr/local/sbin
sudo ./pure-ftpd &
Test it again using FileZilla, and you should now be able to authenticate using a Mac user's credentials and then be able to browse that user's Home directory structure.
Once you get it to work, you need to ensure that it runs at start-up. I haven't tackled that little issue, but it shouldn't be too hard.
Hopefully, this is enough to get you in the right direction and if you do have any hiccups, you can figure it out. I had tried a lot of things before succeeding, so it's possible that I missed some step, although I did uninstall it and redo it using this and it worked.
Good Luck!
Bookmarks