FTP server installation

VHFFS suggests Pure-FTP server.

The way VHFFS manage groups needs careful choice of file permissions, and users are users, so we need to apply a patch to pure-ftpd to enforce and clear some permissions.

Patches can be found on the VHFFS source tree at /vhffs-patches/pureftpd/

We also have already patched and compiled packages. You can use them at your own risks. http://download.tuxfamily.org/vhffs4/debian/pool/main/pure-ftpd/

Download and install packages.

wget http://download.tuxfamily.org/vhffs4/debian/pool/main/pure-ftpd/pure-ftpd-common_1.0.43-1_all.deb http://download.tuxfamily.org/vhffs4/debian/pool/main/pure-ftpd/pure-ftpd-postgresql_1.0.43-1_amd64.deb
dpkg -i pure-ftpd-common_1.0.43-1_all.deb pure-ftpd-postgresql_1.0.43-1_amd64.deb

Then, you need to enable pure-ftpd virtual chroot feature. On Debian you need to edit /etc/default/pure-ftpd-common and change the VIRTUALCHROOT directive to true.

Edit /etc/pure-ftpd/db/postgresql.conf

# If PostgreSQL listens to a TCP socket
PGSQLServer     localhost
PGSQLPort       5432

# Mandatory : user to bind the server as.
PGSQLUser       vhffs

# Mandatory : user password. You *must* have a password.
PGSQLPassword   vhffs

# Mandatory : database to open.
PGSQLDatabase   vhffs

# Mandatory : how passwords are stored
# Valid values are : "cleartext", "crypt", "md5" and "any"
PGSQLCrypt      crypt

# Query to execute in order to fetch the password
PGSQLGetPW      SELECT u.passwd FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id=u.object_id WHERE u.username='\L' AND o.state=6

# Query to execute in order to fetch the system user name or uid
PGSQLGetUID     SELECT u.uid FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id=u.object_id WHERE u.username='\L' AND o.state=6

# Query to execute in order to fetch the system user group or gid
PGSQLGetGID     SELECT u.gid FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id=u.object_id WHERE u.username='\L' AND o.state=6

# Query to execute in order to fetch the home directory
PGSQLGetDir     SELECT u.homedir FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id=u.object_id WHERE u.username='\L' AND o.state=6

Run following commands to configure pure-ftpd:

echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone
echo "yes" > /etc/pure-ftpd/conf/CustomerProof
echo "yes" > /etc/pure-ftpd/conf/DisplayDotFiles
echo "yes" > /etc/pure-ftpd/conf/NoAnonymous
echo "no" > /etc/pure-ftpd/conf/UnixAuthentication
echo "no" > /etc/pure-ftpd/conf/PAMAuthentication
echo "113 002" > /etc/pure-ftpd/conf/Umask
echo "10000" > /etc/pure-ftpd/conf/MinUID
echo "/etc/pure-ftpd/db/postgresql.conf" > /etc/pure-ftpd/conf/PGSQLConfigFile
ln -s /etc/pure-ftpd/conf/PGSQLConfigFile /etc/pure-ftpd/auth/30pgsql

These commands create some config files and the last one create a symbolic link.

Then restart pure-ftpd.
doc/installationguide/ftp-service.txt · Last modified: 2016/10/02 21:01 by gradator
Recent changes RSS feed Creative Commons License Donate Minima Template by Wikidesign Driven by DokuWiki