Difference between revisions of "Pure-ftpd"

From gr0x0rd
Jump to navigation Jump to search
(Created page with "== Installing pure-ftpd == There are many open-source ftp server solutions out there, but this guide focuses on pure-ftp due to its integration with mySQL and apache. '''$''' s...")
 
Line 4: Line 4:
 
  '''$''' sudo emerge -av pure-ftpd
 
  '''$''' sudo emerge -av pure-ftpd
 
after the daemon has been installed, you need to configure it.
 
after the daemon has been installed, you need to configure it.
 
+
'''$''' sudo nano -w /etc/conf.d/pure-ftpd
sudo nano -w /etc/conf.d/pure-ftpd
 
 
 
 
Uncomment the configuration flag
 
Uncomment the configuration flag
 
+
IS_CONFIGURED="yes"
IS_CONFIGURED="yes"
 
 
 
 
Configure ssl support
 
Configure ssl support
 
+
MISC_OTHER="-A '-Y 1' -j -R -Z"
MISC_OTHER="-A '-Y 1' -j -R -Z"
 
 
 
 
Add the MySQL authenticator at the end of the file
 
Add the MySQL authenticator at the end of the file
 
+
AUTH="-l mysql:/etc/pureftpd-mysql.conf"
AUTH="-l mysql:/etc/pureftpd-mysql.conf"
+
Now we will configure ssl support.
 
+
'''$''' sudo mkdir -p /etc/ssl/private
now we will configure ssl support.
+
'''$''' sudo openssl req -x509 -nodes -newkey rsa:1024 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
 
+
Answer the questions asked. Once it is done
sudo mkdir -p /etc/ssl/private
+
'''$''' sudo chmod 600 /etc/ssl/private/pure-ftpd.pem
sudo openssl req -x509 -nodes -newkey rsa:1024 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
+
Next, we'll download a user manager for pureftpd
 
+
'''$''' cd /var/www/localhost/htdocs
answer the questions asked. once it is done
+
'''$''' sudo wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz
 
+
Next we extract the file. Change the filename if you download a more recent file.
sudo chmod 600 /etc/ssl/private/pure-ftpd.pem
+
'''$''' sudo tar zxf ftp_v2.1.tar.gz
 
+
Once the files have extracted, we need to set permissions so that they work correctly
next, we'll download a user manager for pureftpd
+
'''$''' sudo chown -R apache:apache ftp
 
+
'''$''' sudo chmod 664 ftp/config.php
cd /var/www/localhost/htdocs
 
sudo wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz
 
 
 
next we extract the file
 
 
 
sudo tar zxf ftp_v2.1.tar.gz (or whatever version you downloaded)
 
 
 
once the files have extracted, we need to set permissions so that they work correctly
 
 
 
sudo chown -R apache:apache ftp
 
sudo chmod 664 ftp/config.php
 
 
 
 
To start the ftp setup wizard, open a browser and go to
 
To start the ftp setup wizard, open a browser and go to
 
+
http://localhost/ftp/install.php
http://localhost/ftp/install.php
 
  
 
Go through the installation as you see fit. Be sure to change the default password from tmppasswd to  
 
Go through the installation as you see fit. Be sure to change the default password from tmppasswd to  

Revision as of 10:27, 5 August 2011

Installing pure-ftpd

There are many open-source ftp server solutions out there, but this guide focuses on pure-ftp due to its integration with mySQL and apache.

$ sudo emerge -av pure-ftpd

after the daemon has been installed, you need to configure it.

$ sudo nano -w /etc/conf.d/pure-ftpd

Uncomment the configuration flag

IS_CONFIGURED="yes"

Configure ssl support

MISC_OTHER="-A '-Y 1' -j -R -Z"

Add the MySQL authenticator at the end of the file

AUTH="-l mysql:/etc/pureftpd-mysql.conf"

Now we will configure ssl support.

$ sudo mkdir -p /etc/ssl/private
$ sudo openssl req -x509 -nodes -newkey rsa:1024 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem

Answer the questions asked. Once it is done

$ sudo chmod 600 /etc/ssl/private/pure-ftpd.pem

Next, we'll download a user manager for pureftpd

$ cd /var/www/localhost/htdocs
$ sudo wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz

Next we extract the file. Change the filename if you download a more recent file.

$ sudo tar zxf ftp_v2.1.tar.gz

Once the files have extracted, we need to set permissions so that they work correctly

$ sudo chown -R apache:apache ftp
$ sudo chmod 664 ftp/config.php

To start the ftp setup wizard, open a browser and go to

http://localhost/ftp/install.php

Go through the installation as you see fit. Be sure to change the default password from tmppasswd to something else. When you reach the final step, copy and paste the contents of the generated pureftpd-mysql.conf file, and create it.

sudo nano /etc/pureftpd-mysql.conf (copy and paste the file contents and save the file)

once you are done, close the installation wizard. you may find the 16 char limit for user names annoying. to change that, log into mysql as root

mysql -u root -p

change to the ftpusers database

use ftpusers;

modify the users table

alter table users modify User varchar(32);

then exit mysql

quit

next we will try to start the ftp server

sudo /etc/init.d/pure-ftpd start

add the ftp service to startup

sudo rc-update add pure-ftpd default

if all has gone well, we just need to delete the user manager tarball

sudo rm /var/www/localhost/htdocs/ftp_v2.1.tar.gz

and don't forget the rename the publicly accessible installation file (wow!)

sudo mv /var/www/localhost/htdocs/ftp/install.php /var/www/localhost/htdocs/ftp/install