- 论坛徽章:
- 0
|
安装好mysql和quota认证,
用mysql建立一个新的用户test,但使用test这个用户上传文件到mysql指定的homedir---/home/www/test却没有权限,更奇怪的是test可以访问上一级的目录,也就是ftp的根目录/home/www,而且上传文件正常,不知道是什么原因,proftpd.conf文件如下。
希望高人指教。
Port 21
ServerType standalone
DefaultServer on
Umask 022
MaxInstances 30
MaxLoginAttempts 3
User ftpuser
Group ftpuser
MaxHostsPerUser 1 "Sorry, you may not connect more than one time."
MaxClientsPerUser 2 "Only one such user at a time."
MaxClientsPerHost 3 "Sorry, you may not connect more than one time."
UseReverseDNS off
IdentLookups off
RootLogin off
RequireValidShell off
TimeoutStalled 10
MaxClients 10
AllowForeignAddress on
PassivePorts 49152 65534
AllowStoreRestart on
ServerIdent off
DefaultRoot /home/www
<Global>
SQLAuthTypes Backend Plaintext
SQLAuthenticate users* groups*
# databasename@host database_user user_password
SQLConnectInfo proftp@localhost:3306 root cngrain
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1,accessed=now() WHERE userid='%u'" ftpuser
# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
QuotaLog "/var/log/quota"
SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used+ %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND uota_type = '%{7}'" ftpquotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
</Global>
<Directory ~>
<Limit MKD XMKD RNFR RNTO DELE RMD XRMD STOR WRITE>
AllowAll
</Limit>
</Directory> |
|