DEBIAN: How-to install secure pure ftp server chrooted with virtual users


aptitude install pure-ftpd
nano /etc/pure-ftpd.conf
---------
ChrootEveryone yes
BrokenClientsCompatibility no
MaxClientsNumber 10
Daemonize yes
MaxClientsPerIP 5
VerboseLog no
DisplayDotFiles no
AnonymousOnly no
NoAnonymous yes
SyslogFacility ftp
DontResolve yes
MaxIdleTime 15
PureDB /etc/pureftpd.pdb
LimitRecursion 2000 8
AnonymousCanCreateDirs no
MaxLoad 4
UserRatio 5 10
AntiWarez no
UserBandwidth 200
Umask 133:022
MinUID 100
AllowUserFXP no
AllowAnonymousFXP no
ProhibitDotFilesWrite yes
ProhibitDotFilesRead yes
AutoRename no
AnonymousCantUpload yes
AltLog stats:/var/log/pureftpd.log
NoChmod yes
CreateHomeDir yes
Quota 2000:500
MaxDiskUsage 80
CustomerProof yes
PerUserLimits 3:20
IPV4Only yes
------------
nano /etc/default/pure-ftpd-common >>
STANDALONE_OR_INETD=standalone ,
VIRTUALCHROOT=true

nano /etc/pure-ftpd/conf/PureDB >> /etc/pure-ftpd/pureftpd.pdb

cd /etc/pure-ftpd/auth

ln -s /etc/pure-ftpd/conf/PureDB 50pure

sudo groupadd ftpgroup

sudo useradd -g ftpgroup -d /dev/null -s /etc ftpuser

Create our first virtual user

pure-pw useradd joe -u ftpuser -g ftpgroup -d /home/pubftp/joe

We will have to type his password twice, and we are almost ready to go.

Save the password file, I mean create the pure-ftp password database run this command:

pure-pw mkdb

Do this each time you make changes to the password file.

/etc/init.d/pure-ftpd start

Some other tips

To list users

pure-pw list
To see some user's information

pure-pw show joe
Where joe is the user you want to list his info.
To change a password

pure-pw passwd joe
Be sure to update the database by running:

pure-pw mkdb