0

I have configured Vsftpd on Ubuntu 16.04. Everything works fine, but I need one more thing.

Let's say I have:

  • folder /var/www/folder1/uploads
  • Virtual users: admin1, admin2, admin3, customer
  • I use vsftpd_user_conf folder to store users local_root

I want adminX users to have permissions to r/w in 'folder1' and 'uploads', but I want user 'customer' to have only read permission to 'folder1' and read/write permission to 'uploads'. Now I have situation that 'folder1' is read only and every user with access to /var/www/folder1 can write in 'uploads'. Is it possible?

$ ls -la /var/www/folder1
drwxrwxr-x 3 root   root    4096 May  9 17:14 .
drwxr-xr-x 3 root   root    4096 May  9 17:13 ..
drwxr-xr-x 2 vsftpd nogroup 4096 May  9 17:15 upload


$ vsftpd.conf:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
local_root=/var/www
chroot_local_user=YES
allow_writeable_chroot=YES
hide_ids=YES
#virtual user settings
user_config_dir=/etc/vsftpd_user_conf
guest_enable=YES
virtual_use_local_privs=YES
pam_service_name=vsftpd
nopriv_user=vsftpd
guest_username=vsftpd
0

Can you provide ls -la /var/www/folder1 and your cat vsftpd.conf?

And, may be, you can use this:

user_config_dir

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. The format of this file is as detailed in this manual page (see below link).


PLEASE NOTE that not all settings are effective on a per-user basis. For example, many settings only prior to the user's session being started. Examples of settings which will not affect any behaviour on a per-user basis include:

  • listen_address
  • banner_file
  • max_per_ip
  • max_clients
  • xferlog_file
  • etc...

By default no one of these are set.


from Manpage VSFTPD.CONF

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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