1

I'm configuring an FTP server on an embedded Linux system. Iv'e set in my /etc/passwd a number of local users, for example:

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

Problem is that I don't now how to set write_enable (whether any FTP commands which change the file system are allowed or not) per user. I want that UserA will be able to write and UserB not. Example 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

Found the answer in this link. Here an extract of my '/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

Each time a new ftp virtual user need a personal ftp directory, under the dir '/etc/vsftpd/vsftpd-user-conf' I create a file named as the username where I define the personal ftp directory and the auth on it (RO or RW). Example for user '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=YES
0

Set permissions on filesystem.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.