Proftpd

Proftpd:完全禁用使用者登錄

  • October 15, 2018

一個簡單的問題,通過這種配置,我允許匿名 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"

引自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>

引用自:https://unix.stackexchange.com/questions/475684