## Installing Pure-FTPD

I have had some need of a light and secure ftp-server from time to time. My preference in this matter goes out to Pure-FTPD. I’ll give a short commandline tutorial to install it, add a user and set folder permissions. This tutorial is specific to Ubuntu (and Backtrack) but It can easily be replicated for any other linux distro, it also supposes you install the server as root (if this is not the case add the appropriate "su" command at the beginning). This process can be poured into a bash script if you like…

(1) Fetch pure-ftpd from aptitude.

    root@bt:~/Desktop# apt-get install pure-ftpd

(2) Create a group for Pure-FTPD.

    root@bt:~/Desktop# groupadd ftpgroup

(3) Add a user to the group (revoke the home directory and deny acces to shell login).

    root@bt:~/Desktop# useradd -g ftpgroup -d /dev/null -s /etc ftpuser

(4) Create a directory for your ftp-files (you can also specify a specific user e.g.: /root/ftphome/bob).

    root@bt:~/Desktop# mkdir /root/ftphome

(5) Create a ftp-user, in our example "bob" (again you can set "-d /root/ftphome/bob/" if you wish).

    root@bt:~/Desktop# pure-pw useradd bob -u ftpuser -g ftpgroup -d /root/ftphome/

(6) Update the ftp database after adding our new user.

    root@bt:~/Desktop# pure-pw mkdb

(7) This is optional, you can list the users in the database, and enumerate spesific users...

    root@bt:~/Desktop# pure-pw list
    root@bt:~/Desktop# pure-pw show bob

(8) We set symbolic links for some files.

    root@bt:~/Desktop# ln -s /etc/pure-ftpd/pureftpd.passwd /etc/pureftpd.passwd

(9) We set symbolic links for some files.

    root@bt:~/Desktop# ln -s /etc/pure-ftpd/pureftpd.pdb /etc/pureftpd.pdb

(10) We set symbolic links for some files.

    root@bt:~/Desktop# ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/PureDB

(11) The specified ftp directory (and all it's sub-direcotries) needs to be owned by "ftpuser".

    root@bt:~/Desktop# chown -R ftpuser:ftpgroup /root/ftphome

(12) Finally we restart Pure-FTPD. You should now be able to log in with your created user account.

    root@bt:~/Desktop# /etc/init.d/pure-ftpd restart