一个简单的问题,通过此配置我允许匿名 ftp 用户。
ServerName "ProFTPD Default Installation"
ServerType standalone
DefaultServer on
Port 2121
Umask 022
MaxInstances 30
User ftp
Group ftp
SystemLog /var/log/proftpd.log
TransferLog /var/log/xferlog
PassivePorts 49152 65535
UseFtpUsers off
<Directory /*>
AllowOverwrite on
</Directory>
<Limit LOGIN>
AllowUser ftp
AllowUser anonymous
DenyAll
</Limit>
<Anonymous ~ftp>
RequireValidShell off
User ftp
Group ftp
# We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp
# Limit the maximum number of anonymous logins
MaxClients 50
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayChdir .message
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
# An upload directory that allows storing files but not retrieving
# or creating directories.
</Anonymous>
但使用
ftp localhost 21
它要求输入密码 我的问题是:如何完全禁用用户登录以仅允许匿名?我想要一个这样的答案
"sorry ftp server is only anonymous"
答案1
引用自ProFTPD:配置限制
如果网站只允许匿名访问怎么办?这可以使用 LOGIN 命令组进行配置,如上所述:
<Limit LOGIN>
DenyAll
</Limit>
<Anonymous ~ftp>
<Limit LOGIN>
AllowAll
</Limit>
...
</Anonymous>
该
<Limit>
部分之外的部分<Anonymous>
拒绝所有人登录。然而,该<Anonymous>
部分有一个<Limit>
允许每个人登录的;允许匿名登录,拒绝非匿名登录。
PS 您可能想在sorry.msg 文件中使用“抱歉ftp 服务器只是匿名”文本创建单独的DisplayLogin sorry.msg
外部部分。<Anonymous>