Create an ftpgroup
group and an ftpuser
user.
groupadd ftpgroupMaintenance virtual users with
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
pure-pw
Only uname, password, uid, gid & home directory are required.
pure-pw useradd uname -D|-d home directory -u uid [-g gid]Example: create
[-c gecos] [-t download bandwidth] [-T upload bandwidth]
[-n max number of files] [-N max Mbytes]
[-q upload ratio] [-Q download ratio]
[-r allow client host/mask][,allow client host/mask]]...] [-R deny client host/mask][,deny client host/mask]]...]
[-i allow local host/mask][,allow client host/mask]]...] [-I deny local host/mask][,deny local host/mask]]...]
[-y max number of concurrent sessions] [-z hhmm-hhmm]
[-f passwd file]
[-m]
joe
, home directory /home/ftpusers/joe
, system account associated is ftpusers
.
pure-pw useradd joe -u ftpuser -d /home/ftpusers/joe
-m |
pure-pw show uname [-f passwdfile]
example:Login : joe Password : 6GMHJRyUdSRwNROunwtRbEDHlx5t3eNQew7bb1dz29K2 UID : 500 (ftpuser) GID : 101 (ftpgroup) Directory : /home/ftpusers/joe/./ Full name : Download bandwidth : 0 Kb (unlimited) Upload bandwidth : 0 Kb (unlimited) Max files : 1000 (enabled) Max size : 10 Mb (enabled) Ratio : 0:0 (unlimited:unlimited) Allowed local IPs : Denied local IPs : Allowed client IPs : 192.168.0.0/16 Denied client IPs : 192.168.1.1,blah.verybadhost.com Time restrictions : 0900-1800 (enabled) Max sim sessions : 0 (unlimited)
/./
at the end of a home directory means that this user will be chrooted.
pure-pw usermod
Example: Add a quota to Joe. limited to 1000 files and 10 Megabytes.
pure-pw usermod joe -n 1000 -N 10
pure-pw usermod username
:
run mkdb on exit | -m
|
pure-pw userdel login [-f passwd file] [-m]
pure-pw passwd uname [-f passwd file] [-m]
/etc/pureftpd.passwd
to /etc/pureftpd.pdb
pure-pw mkdb
--with-puredb
to
./configure
(--with-everything
also enables it and binary packages have it compiled in) .
add this switch to pure-ftpd switches:
--login puredb:/path/to/puredb_file
Run the server with automatic creation of home directories and puredb authentication:
/usr/local/sbin/pure-ftpd -j --login puredb:/etc/pureftpd.pdb & # in background
Execute as root to include passwords.
$PURE_PASSWDFILE
path, default /etc/pureftpd.passwd
$PURE_DBFILE
path, default /etc/pureftpd.pdb
Install libsodium
(http://doc.libsodium.org) before compiling Pure-FTPd.
One line per user.
account:password:uid:gid:gecos:home directory:upload bandwidth:download bandwidth:upload ratio:download ratio:max number of connections:files quota:size quota:authorized local IPs:refused local IPs:authorized client IPs:refused client IPs:time restrictionspureftpd Documentaion