3

I'm trying to setup a ftp account for a user that has read/write access to one folder: /items/myuser

I've set up the account with username 'myuser' in Linux with the adduser command. After that, I've changed my /etc/vsftpd.conf file to:

chroot_local_user=NO
chroot_list_enable=YES
user_config_dir=/etc/vsftpd_user_conf

I've also edited the /etc/vsftpd.chroot_list and added 'myuser' to this list.

After that, I've edited /etc/vsftpd_user_conf/myuser and added the following line:

local_root = /items/myuser

After that, I've created this local_root folder and ran the following commands:

chown myuser:myuser /items/myuser
chmod ug-w /items/myuser

mkdir /items/myuser/homefolder
mount --bind /items/myuser /items/myuser/homefolder

I can login and I'm restricted to this folder and his subfolders but when I want to write a file, I'm getting an 553 error.

Does anyone know what I've forgotten to do?

Thanks in advance!

2 Answers 2

1

You are removing the user's permission to write his home:

chmod ug-w /items/myuser

By the way, what is the purpose of this bind-mount?

mount --bind /items/myuser /items/myuser/homefolder
1

I have it working now. I've searched some around on the internet and I've found a workaround. As my local_root must not be writeable, I've created a subfolder inside this this unwriteable directory with write permissions because only the root directory needs to be unwriteable.

1
  • Please, can u elaborate a little further on how did u fixed this ? Commented Dec 7, 2022 at 17:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .