我希望我的服务器上运行 FTPd,并能轻松地设置用户/目录。我不需要 MySQL、匿名访问、本地用户等。最好将用户设置设为一个普通文件,其中包含类似
username 1 password hash /root/dir
username 2 password hash /root/dir
username 3 password hash /root/dir
使用虚拟用户设置 FTPd 的最快最简单的方法是什么?
答案1
ProFTPd 提供您所要求的功能:
ProFTPD allows for the definition of "virtual" users: users who do not have accounts on
the host machine, whose account information is defined in other sources. The passwords for
these users are then specific only to FTP access, and thus do not expose shell access
(ssh, hopefully) to unauthorized users. These alternative account information sources
include SQL tables (via mod_sql), LDAP servers (via mod_ldap), CDB files (via
mod_auth_cdb), and other system files (via the AuthUserFile and AuthGroupFile
configuration directives). The proftpd server can be configured to use multiple account
information sources simultaneously as well, allowing for flexible support of a range of
environments.
我个人使用 ProFTPd 的 mod_sql 插件来避免使用 OS 用户进行 FTP 访问。您可以在此处找到有关此解决方案是否适合您的更多信息:
答案2
看一下这文章。它包含使用虚拟用户设置 VSFTPD 的信息。在 Google 上搜索“+linux +ftp +virtual users”也会提供很多您可以尝试的选项。