欢迎来到资源库(www.zyku.net)

工具资源

当前位置:首页 > 网站运营 > 工具资源 > Pure-FTPd

pure-ftpd上传权限修改设置教程

时间:2017-11-05|栏目:工具资源|点击:|我要投稿

pure-ftpd不得不说是一款非常好用的ftp工具,下面说说如何配置pure-ftpd:

我们安装完pure-ftpd之后,上传文件后发现路径权限为:-rw-r--r--,那么当我们执行php脚本时,会显示:403 Forbidden,那么我们必须重新配置pure-ftpd的上传权限。

pure-ftpd 预设上传权限为:

档案 600 目录 700

这对权限控管很好用 , 但如果针对网页主机而言的话就不见得,因网页至少需要 644 甚至 666 才能正常开启网页

找到pure-ftpd的配置文件: /etc/pure-ftpd/pure-ftpd.conf


# Cage in every user in his home directory

ChrootEveryone    yes

# 限定每一个使用者都只能在自己家目录下活动。当设定成 no 时,则 Real User 可切换至其他

# 目录做存取。


# If the previous option is set to "no", members of the following group won't be caged. Others will be.

# If you don't want chroot()ing anyone,just comment out ChrootEveryone and TrustedGID.

# TrustedGID     100

# 当您将註解拿掉后,GID 100 的群组成员会被视為信任的使用者,因此可以存取家目录外的

# 其他目录。此时无论 ChrootEveryone 设定為何,都是一样的结果。


# Maximum number of simultaneous users

MaxClientsNumber   10

# 限定最大连线数為 10。


# Maximum number of sim clients with the same IP address

MaxClientsPerIP     3

# 限定同一来源端位址的最大连线数為 3。


# List dot-files even when the client doesn't send "-a".

DisplayDotFiles     yes

# 这个参数设定成 yes 的话,则 Client 可以看到档名是以 "." 作开始的隐藏档。


# Don't allow authenticated users - have a public anonymous FTP only.

AnonymousOnly    yes

# 是否只允许匿名登入。当您希望 Real User 也能登入时,就设定成 no。


# Disallow anonymous connections. Only allow authenticated users.

NoAnonymous     no

# 是否不允许匿名登入。当设定成 no,表示允许匿名登入,但如果您希望只有 Real User 能经

# 由认证登入时,这裡就设定成 yes 吧。


# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)

# The default facility is "ftp". "none" disables logging.

SyslogFacility     ftp

# 您可以在 /etc/syslog.conf 裡使用 ftp 这个 facility,来告知 syslogd 要将 ftp 的相关讯息纪录到

# 哪裡,比如: ftp.*   /var/log/ftplog


# Don't resolve host names in log files. Logs are less verbose, but it uses less bandwidth. Set this to "yes"

# on very busy servers or if you don't have a working DNS.

DontResolve      yes

# ftp 的纪录档是否不需解析主机名称。


# Maximum idle time in minutes (default = 15 minutes)

MaxIdleTime      15

# 设定 FTP Client 端的閒置时间為 15 分鐘。


# PureDB user database (see README.Virtual-Users)

# PureDB   /etc/pure-ftpd/pureftpd.pdb

# 这是使用虚拟帐号登入时,所指定要使用的资料库。


# If you want to enable PAM authentication, uncomment the following line.

PAMAuthentication    yes

# 是否使用 PAM 认证模组来对使用者作认证。


# If you want simple Unix (/etc/passwd) authentication, uncomment this.

# UnixAuthentication  yes

# 是否依照传统的 /etc/passwd 来做认证。


# Are anonymous users allowed to create new directories ?

AnonymousCanCreateDirs  no

# 是否允许 anonymous 建立新目录。如设定成 yes,则 anonymous 虽可建立目录,但无法删除。


# Port range for passive connections replies. - for firewalling.

# PassivePortRange 30000 50000

# 当 Client 端採用被动模式来建立资料通道时,FTP Server 预计所要使用 data channel 连接埠的范围。

# 当您 Linux Client 端执行 ncftp 或 ftp 指令连上 FTP 站台后,可使用 passive 指令来变更连线模式。


# Upload/download ratio for anonymous users.

# AnonymousRatio   1 10

# 设定 anonymous 上传/下载比率。

# 以 1:10 而言,如果 anonymous 上传了 1MB 的资料后,就能够下载 10MB 的档案资料。


# Upload/download ratio for all users. This directive superscedes the previous one.

# UserRatio      1 10

# 设定 All User 上传/下载比率。当 AnonymousRatio 及 UserRatio 都做设定时,是以 UserRatio 為主。


# Disallow downloading of files owned by "ftp", ie.

# files that were uploaded but not validated by a local admin.

AntiWarez       yes

# 匿名使用者要下载的档案,如果其拥有者是 ftp 的话,则不允许下载。当您的 FTP 站台开放 anonymous 上传时 (上

# 传之后的档案拥有者為 ftp),為了防止有些人会上传一些有问题的档案来供人下载,因此才设定这个参数 ; 而等

# 管理者确认上传的档案没问题后,就可以把此档的拥有者做个改变,这样就能提供正常下载了。


# IP address/port to listen to (default=all IP and port 21).

# Bind       127.0.0.1,21

# 设定 FTP Server 要在哪个介面位址监听哪个 port。预设是允许在所有介面位址监听 21 port。


# Maximum bandwidth for anonymous users in KB/s

# AnonymousBandwidth 8

# 设定 anonymous 最大上传、下载频宽,单位為KB/s。


# Maximum bandwidth for *all* users (including anonymous) in KB/s.

# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.

# UserBandwidth    8

# 设定 All User 最大上传、下载频宽。当 AnonymousBandwidth 及 UserBandwidth 都设定时,是以 UserBandwidth 為主。


# File creation mask. <umask for files>:<umask for dirs> . 177:077 if you feel paranoid.

Umask        177:077

# 设定上传档案、目录 (含建立新目录) 的预设权限,177:077 表示档案的预设权限為 600,目录為 700。


# Minimum UID for an authenticated user to log in.

MinUID        100

# 设定能允许 Real User 认证登入的最小 UID 為 100,也就是说 UID 100 以上 (含100) 的使用者方可认证登入。

# 如您欲允许 root 登入的话,这个地方请註解起来,并且在 /etc/ftpusers 档案中将 root 帐号移除。

# /etc/ftpusers 是用来设定拒绝登入 FTP Server 的使用者名单的。


# Users can't delete/write files beginning with a dot ('.') even if they own them. If TrustedGID is enabled,

# this group will have access to dot-files, though.

ProhibitDotFilesWrite   yes

# 是否要禁止使用者删除或修改隐藏档,即使使用者就是该隐藏档的拥有者。设定 yes 就表示要禁止啦。


# Prohibit *reading* of files beginning with a dot (.history, .ssh...)

ProhibitDotFilesRead  no

# 是否要禁止使用者读取隐藏档内容。当以上两个参数都设定 no 时,表示使用者对隐藏档具有 r 及 w 的权限 (anonymous

# 為例外)。当 ProhibitDotFilesWrite 设定成 no,而 ProhibitDotFilesRead 设定成 yes 时,使用者是不能删除档案的。但是无论

# 如何设定,只要 TrustedGID 有设定时,则此群组的成员认证进来后是可以具有 r 及 w 的权限,并不会受到这裡的规范。


# Never overwrite files. When a file whoose name already exist is uploaded,

# it get automatically renamed to file.1, file.2, file.3, ...

AutoRename       yes

# 当上传档案时,若对方目录内已经存在一个同档名的档案,则允许将上传的那个档案作自动更名的动作。


# Disallow anonymous users to upload new files (no = upload is allowed)

AnonymousCantUpload yes

# 是否要拒绝 anonymous 上传。如要开放匿名使用者上传档案的话,就设定成 no。另外要允许上传目录时,除了这裡要

# 设定成 no 以外,AnonymousCanCreateDirs 参数需设定成 yes 才行。


# Disallow the CHMOD command. Users can't change perms of their files.

#NoChmod       yes

# 是否要拒绝使用者执行 chmod 指令来修改权限。


# Allow users to resume and upload files, but *NOT* to delete them.

#KeepAllFiles     yes

# 当设定成 yes 时,表示使用者无法删除伺服器上的档案。


# Automatically create home directories if they are missing

#CreateHomeDir    yes

# 当使用者家目录不存在,是否要自动建立起来。


# This option is useful with servers where anonymous upload is allowed. As /var/ftp is in /var, it save some

# space and protect the log files. When the partition is more that X percent full,new uploads are disallowed.

MaxDiskUsage     99

# 假使我们将 anonymous 的家目录改成 /var/ftp (修改 /etc/passwd ),然后又设定允许匿名使用者上传,那这个参数就很好用

# 了,因為当 /var partition 的使用空间达 99% 时,就不允许匿名使用者再上传资料,不然 /var/log 目录下的那些记录档可就

# 无法持续记录一些重要资讯了。


# Set to 'yes' if you don't want your users to rename files.

NoRename        yes

# 是否要拒绝使用者修改档案目录的名称 (重新命名)。

(资源库 www.zyku.net)

上一篇:pure-ftpd无法停止的临时解决方法

栏    目:工具资源

下一篇:阿里云服务器安全组规则配置教程

本文标题:pure-ftpd上传权限修改设置教程

本文地址:https://www.zyku.net/gongju/1554.html

关于我们 | 版权申明 | 寻求合作 |

重要申明:本站所有的文章、图片、评论等内容,均由网友发表或上传并维护或收集自网络,仅供个人学习交流使用,版权归原作者所有。

如有侵犯您的版权,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:95148658 | 邮箱:mb8#qq.com(#换成@)

苏ICP备2020066115号-1

本网站由提供CDN加速/云存储服务