1

I followed the nice tutorial from https://askubuntu.com/questions/575523/how-to-setup-virtual-users-for-vsftpd-with-access-to-a-specific-sub-directory

Now If I understood I have 2 things:

1) one is the only user called vsftpd that acts as dedicated-user for the vsftpd service

2) is the capability of creating users specific configurations under the /etc/vsftpd_user_conf/ folder

so I can have a /etc/vsftpd_user_conf/user1 file maybe filled with:

local_root=/var/www/website_name1/sub_folder1

a /etc/vsftpd_user_conf/user2 with specific

local_root=/var/www/website_name1/sub_folder2

and so on..


With this setup I can set the main or the sub_folders inside their roots and make them writable by assigning or not the chmod vsftpd:nogroup and the common 777, 775 or 664 common attributes.


But I would like to create a more complex setup.

I would like to create a folder:

/var/ftp_users/

with

/var/ftp_users/boss
/var/ftp_users/employee1
/var/ftp_users/employee2
/var/ftp_users/employee3
...

In order to make them accessible and writable I will have to

chmod vsftpd:nogroup /var/ftp_users/boss
chmod vsftpd:nogroup /var/ftp_users/employee1
chmod vsftpd:nogroup /var/ftp_users/employee2
...

and also set their local root as follows:

/etc/vsftpd_user_conf/employee1 with local_root=/var/ftp_users/employee1
/etc/vsftpd_user_conf/employee2 with local_root=/var/ftp_users/employee2
/etc/vsftpd_user_conf/employee3 with local_root=/var/ftp_users/employee3
...

The problem is that BOSS asked me to:

  • being able to read everyone folders so that he can see what other users are doing. My idea was to put his local_root=/var/ftp_users

  • BUT -- I want that boss to be able to write/modify only /var/ftp_users/boss and not everyone other folders, create new ones or delete the ones he found inside !

How is it possible in this setup so that user boss has local_root=/var/ftp_users BUT its write access is only limited to /var/ftp_users/boss ?

I also considered manually create symlinks inside

ln /var/ftp_users/employee1 /var/ftp_users/boss/employee1

and

chmod -h 0444 /var/ftp_users/boss/employee1

but this way is not working properly.

I'm used to the Windows permissions or the directives you can specify inside Apache, nginx and so on, so I'm a bit lost with vsftpd config. Under normal circumstances I would have set the /var/ftp_users/ root non writable and only the /var/ftp_users/boss folder writable.

Your Answer

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

Browse other questions tagged or ask your own question.