Install & Run Pure-FTPD Server On PCLinuxOS
by David Moore (YouCanToo)
So you want to install and run an FTP server?
First, you must choose one of the many FTP server offered in PCLinuxOS. For this how-to, I will choose one of the following three big ones. All are available in Synaptic, along with many others.
VSFTPD
PROFTPD
Pure-FTPd
I chose Pure-FTPd. The reason I chose this is because it is fast, secure and it also has a GUI module for Webmin. PROFTPD also has A GUI module for Webmin. Unfortunately, VSFTPD does not. If you do not intend on using Webmin or don’t need a GUI, VSFTPD is a very secure and fast server, and easy to setup and run.
Since I chose Pure-FTPd, I will also need to load Webmin from Synaptic. Once loaded, I will need to download the pureftpd.wbm module for it from Webmin.com.
Now, we will begin the process by installing some packages. Open Synaptic and click on “Reload” first. When that has finished, search for Webmin and mark it for installation. Then, search for Pure-FTPd and mark it for installation. Click the “Apply” button. Webmin may require other packages to be installed.
Once we have installed these packages, we need to make sure these services are set to start upon booting. Open PCC (PCLinuxOS Control Center), choose “System,” and then choose “Manage system services by enabling or disabling them.” Scroll down the list until you find Pure-FTPd. There will be two different ones listed:
Pure-FTPd
Pure-FTPd-xinetd
Note: Only check one of these two services to start! I[d]f the Pure-FTPd service is not already checked, make sure the box labeled “On boot” has been checked. DO NOT check the pure-ftpd-xinetd service. Now, click on the start button. This is going to start up the Pure-FTPd server. We will see some dialog saying that Pure-FTPd stop failed. This is normal, since it was not running to begin with. Then, below that, we will see something like this:
Starting Pure-FTPd: Running: /usr/sbin/Pure-FTPd --daemonize -A -c50 -B -C8 -D -fftp -H -I15 -lpam -L10000:8 -m4 -s -U133:022 -u100 -Oclf:/var/log/pureftpd.log -k99 -Z
OK
Congratulations! Our basic FTP server is running. We DO NOT have to go any further if we simply want to use the Pure-FTPd default values. Installing Webmin just gives us a GUI to make changes to these values. We can also edit the Pure-FTPd configuration file from a console window.
Now to start Webmin, open a console window as the root user, and type the following:
cd /etc/webmin
and then enter the command
./start
Webmin will ask some setup questions. Just press return to use the default settings. It will eventually ask for a login password. We will need to enter one of our choosing. Note that our password will not be echoed to the screen. After entering our password, it will ask if we want to use SSL (Secure Socket Layer). We will need to either enter a 'y' for yes, or a 'n' for no. I suggest we choose 'y' and use SSL to access the webmin GUI. After this, it will ask us if we want Webmin to start at boot time. Again, I would choose ‘y.’ Now Webmin will setup its configuration, and then tell us how to access the GUI.
https://localhost:10000
Now, in our web browser, go to https://localhost:10000 and connect to Webmin. The first thing we will notice is that our web browser is going to complain.
Click on “I Understand the Risks.” Now another more dialog will popup saying:
Click on the “Add Exception” button. Well, we are almost done. Another dialog box will open. Click on the “Confirm Security Exception” button on the lower left of the dialog box.
The dialog box will vanish, and we should be greeted with Webmin's login page. Now, lets login to Webmin. Enter the username. Just in case you were sleeping, the default username is “admin.” The password is the one that we chose during the setup.
Now that we have logged into Webmin, we need to install the Pure-FTPd module. To do this, in the left hand pane, click on “Webmin.” From the menu, click “Webmin Configuration,” and from the right hand pane, choose “Webmin Modules.”
Now locate the pureftpd.wbm module that you downloaded from from Webmin.com and saved to your hard drive. Once selected, click the “Install Module” button. If everything went right, you will see:
The following modules have been successfully installed and added to your access control list:
Pure-FTPd server in /opt/webmin-1.580/pureftpd (212 kB) under category Servers
In the left hand pane, click on “Servers” and then ”Pure-FTPd Server.” Once more, move over to the right hand pane and click on “Module Config.”
In the image, these are the lines we need to change. We need to remove the word “local” from each line. Also, we need to change the line for the Pure-FTPd config file to “/etc/Pure-FTPd/Pure-FTPd.conf.” The paths should look the same as the ones in the image above. Once this has been done, scroll to the bottom of the page and click “Save.” Now you will be greeted with Pure-FTPd Server GUI Page.
From this page, we can change your Pure-FTPd configuration, add Pure-FTPd users and see who is logged onto our FTP server under the Pure-FTPd Monitor button. One last thing has to be done. Click on the Pure-FTPd configuration button. This will bring up the configuration file. Scroll down untill you find the following section:
# If you want to enable PAM authentication, uncomment the following line
PAMAuthentication yes
# If you want simple Unix (/etc/passwd) authentication, uncomment this
# UnixAuthentication yes
This needs to be changed to read:
# If you want to enable PAM authentication, uncomment the following line
# PAMAuthentication yes
# If you want simple Unix (/etc/passwd) authentication, uncomment this
UnixAuthentication yes
Notice that the PAMAuthentication line has been commented out and the UnixAuthentication line has been uncommented. Once these changes have been made, click “Apply Changes,” and then “Save.” Now we are ready to use our newly installed FTP server.
For those of you that did not install Webmin, you also have to edit the Pure-FTPd configuration file. You will find it at /etc/Pure-FTPd/Pure-FTPd.conf, and you will need root access to edit the file. You need to make the same changes to the PAMAuthentication and the UnixAuthentication as we did above. To restart the server, as root in a console window enter the following:
[root@laptop webmin-1.580]# service Pure-FTPd restart
Stopping Pure-FTPd: [ OK ]
Starting Pure-FTPd: Running: /usr/sbin/Pure-FTPd --daemonize -A -c50 -B -C8 -D -fftp -H -I15 -lunix -L10000:8 -m4 -s -U133:022 -u100 -Oclf:/var/log/pureftpd.log -k99 -Z [ OK ]
[root@laptop webmin-1.580]#
For more information about the different configuration settings, see man Pure-FTPd, or visit the Pure-FTPd Document Page at http://www.pureftpd.org/project/Pure-FTPd/doc.