每个用户的 FTP 服务器 (VSFTP)“write_enable=YES”配置

每个用户的 FTP 服务器 (VSFTP)“write_enable=YES”配置

我正在嵌入式 Linux 系统上配置 FTP 服务器。我在我的/etc/passwd本地用户中设置了一些,例如:

UserA:14:50:FTP User A:/somepath:/bin/sh
UserB:1000:0:FTP User B:/somepath:/bin/sh

问题是我现在不知道如何为write_enable每个用户设置(是否允许任何更改文件系统的 FTP 命令)。我希望UserA能写而UserB不会。例子local.vsftpd.conf

anonymous_enable=NO
local_enable=YES
userlist_deny=YES
userlist_enable=YES
userlist_file=/UNI/System/Config/deny_vsftpd_user_list.conf
listen=YES
chroot_local_user=YES
xferlog_std_format=NO
xferlog_enable=YES
vsftpd_log_file=/tmp/vsftpd.log
allow_writeable_chroot=YES
write_enable=YES

答案1

在此找到了答案关联。这是我的“/etc/vsftpd.conf”的摘录:

# This powerful option allows the override of any config option specified
# in the manual page, on a per-user basis. Usage is simple, and is best
# illustrated with an example. If you set user_config_dir to be /etc/vsftpd_user_conf
# and then log on as the user "chris", then vsftpd will apply the settings
# in the file /etc/vsftpd_user_conf/chris for the duration of the session.
# Default: (none)
user_config_dir=/etc/vsftpd/vsftpd-user-conf

每次新的 ftp 虚拟用户需要个人 ftp 目录时,在目录“/etc/vsftpd/vsftpd-user-conf”下,我创建一个名为用户名的文件,在其中定义个人 ftp 目录及其身份验证(RO或RW)。用户“test”的示例(文件“/etc/vsftpd/vsftpd-user-conf/test”):

# vsftpd per-user basis config file (override of any config option specified
# in the vsftpd server config file)
#
# TEMPLATE
#
# User test - Description for user test
#

# Set local root
local_root=/srv/vsftpd/test

# Disable any form of FTP write command.
# Allowed values: YES/NO
write_enable=YES

答案2

设置文件系统的权限。

chown -R userA /somepath
chmod -R 755 /somepath

相关内容