因为在另外一台机器上已经配置过,本以为很简单,复制过来就可以,没想到还是出问题,检查了半天,发现是group table没有设置的原因。
安装:
sudo aptitude install proftpd proftp-pgsql
配置:
在/etc/proftpd/proftpd.conf里把
#Include /etc/proftpd/sql.conf
这行的注释去掉,然后修改/etc/proftpd/sql.conf文件,修改为:
SQLBackend postgres
SQLEngine on
SQLAuthenticate users
SQLAuthTypes Crypt Plaintext
SQLConnectInfo db@server_name_or_ip user passwordRequireValidShell off
SQLUserInfo ftp.users userid passwd uid gid homedir shell
SQLGroupInfo ftp.groups groupname gid members
SQLDefaultUID 108 # CHANGE FOR YOUR FTP USERS UID FOUND IN /etc/passwd
SQLDefaultGID 1002 # CHANGE FOR YOUR FTP USERS GID, FOUND IN /etc/groups
SQLDefaultHomedir /home/ftp
RequireValidShell offSQLNegativeCache off
# 调试时打开
#SQLLogFile /var/log/proftpd-sqlSQLNamedQuery updatecount UPDATE “count=count+1 WHERE userid=’%u’” ftp.users
SQLLOG PASS updatecountSQLNamedQuery count SELECT “count from ftp.users where userid=’%u’”
SQLShowInfo PASS “230” “You’ve logged on %{count} times, %u”SQLLog STOR newfile
SQLNamedQuery newfile FREEFORM “INSERT INTO ftp.logs(userid,action,file,abs_path,bytes) VALUES (‘%U’,’upload’,’%J’,’%f’, ‘%b’)”SQLLog RETR insertfileinfo
SQLNamedQuery insertfileinfo FREEFORM “INSERT INTO ftp.logs(userid,action,file,abs_path,bytes) VALUES (‘%U’,’download’,’%J’,’%f’, ‘%b’)”
数据库可以参考:http://www.howtoforge.com/proftpd_postgresql_auth_logging
发表回复