我正在嵌入式Linux系统上配置FTP服务器。在我的/etc/passwd中设置了一些本地用户,例如:
UserA:14:50:FTP User A:/somepath:/bin/sh
UserB:1000:0:FTP User B:/somepath:/bin/sh问题是,我现在不知道如何为每个用户设置write_enable (是否允许任何改变文件系统的命令)。我希望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发布于 2016-11-20 04:49:48
在这个链接中找到了答案。这里是我的‘/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目录时,在dir '/etc/vsftpd/vsftpd- user -conf‘下,我创建一个名为username的文件,在其中定义个人ftp目录及其上的auth (RO或RW)。例如,用户'test‘(file '/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=YEShttps://unix.stackexchange.com/questions/323910
复制相似问题